Sanchit Agrawal
Sanchit Agrawal

Reputation: 1

cordova background geolocation not working on background

We have a location based cross platform app built using Ionic. We had built the ability to receive notifications based on the user location using the christocracy plugin at : https://github.com/christocracy/cordova-plugin-background-geolocation.

Unfortunately, this works only when the app is open. Besides, there is a display in the android drawer that background location is on.

We are unable to find an option where we can obtain user location even after the app is closed and serve notifications based on the user's location. Please suggest any solution or plug-in which can solve the purpose.

Upvotes: 0

Views: 2474

Answers (2)

max_code
max_code

Reputation: 307

question might be old, but posting this might help others

using the following plugin you can fetch locations even if the application is in the background. it has options like 'stopOnTerminate' and 'startonboot', which helps you getting you location updates even after the reboot or OS kills the app

https://github.com/mauron85/cordova-plugin-background-geolocation

Upvotes: 1

Bhavesh Jariwala
Bhavesh Jariwala

Reputation: 875

Currently there is no such plugin available that can fetch you location co-ordinates for the device while your app is in background / suspended / killed.

You must develop native android cordova plugin which can do so for you. Remember this will involve Native platform implementation.

Upvotes: 2

Related Questions