Ionic 2 : Run a background service with cordova

I use Ionic 2 and I want to my app do some task when the app is closed. Something like Gmail who continue to notify all the time.

I found this :

  • ViewPager inside a ScrollView does not scroll correclty
  • How can I tell if the screen is on in android?
  • Why does my OnLocationChanged() never get called?
  • What is new in Drawable Tinting in Android L Developer Preview compared to previous version?
  • What is sharedUserId in Android, and how is it used?
  • How can I refresh the cursor from a CursorLoader?
  • But I want to create a specific service with specifics method who run in background. This plugin all the application run in background.

    Someone can explain me how to do that ?

  • GooglePlayServicesUtil vs GoogleApiAvailability
  • How to detect swipe direction between left/right and up/down
  • Show DialogFragment with animation growing from a point
  • getExtractedText on inactive InputConnection warning on android
  • Custom Alert dialog not centered vertically on Android
  • Include Stetho only in the debug build variant
  • One Solution collect form web for “Ionic 2 : Run a background service with cordova”

    I wanted to keep to received notifications when app is closed. I try a solution : Use Push Notification, Firebase for Android and APNS for iOS.
    This solution works but with 2 problems :

    • Have to use external services

    • It can be a little bit hard to configure

    I hope this can help. I know I don’t explain how we can have a service to run in background … But that is the solution for my problem.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.