I'm deploying an app with Ionic framework. The app basically need to receive push notifications based on (specific) user position. Those notifications are location dependant, so I'm trying to figure out if it's possibile to retrieve current user location without ask the user to run the app. I know that push notifications are received even if app is not running, what I'd like to do is to show notifications only if the user is in a specific area. Thanks
Asked
Active
Viewed 4,287 times
1
-
you need a cordova plugin to do this check out those two plugins https://github.com/katzer/cordova-plugin-background-mode ------- https://github.com/transistorsoft/cordova-background-geolocation-lt – Anas Omar Sep 15 '15 at 10:18
-
@AnasOmar thanks for the suggest it seems that is a good start point for what I'm looking for. Do you know why background mode is not store compilant (as stated in the official repo docs)? – cardy Sep 15 '15 at 14:44
1 Answers
0
I know that push notifications are received even if app is not running
That's not true. Push notifications let your application notify a user of new messages or events even when the user is not actively using your application, but application must be started and running in background.
You must perform 2 different actions:
- Execute app on startup to allow it to perform actions needed.
- Use GPS in background to know when device is in the desired position to notify.

Community
- 1
- 1

Jordi Castilla
- 26,609
- 8
- 70
- 109
-
so basically every app on my smartphone that uses push notifications such as Facebook or Whatsapp always runs in background even if not started by me? – cardy Sep 15 '15 at 14:47
-
-
another thing is: some apps have a little push process that runs in background and this process make notifications, causing app opens when clicked. But something is running in the background always – Jordi Castilla Sep 15 '15 at 14:49
-
what's the deal in doing a separate process? It's for performances / battery drain reason or is there something more? Push notification behaviour is the same for both remote and local notifications? – cardy Sep 15 '15 at 15:18
-
More for performance but also battery drain, background process are (even small) battery vampires because they use device resources continously, but a big app opened affects more to performance than a small one, – Jordi Castilla Sep 15 '15 at 16:01