How to get Geolocation when app is closed (killed)

Hello ionic members,

I need to get the position of mobile when application is closed == killed, like whatsapp or facebook or many apps ,so i can receive the location of mobile and send it to my server every 1 hour. i have tried background mode and powerManagement and backgroundGeolocation plugins but it didnt work when app closed(killed == not in background and not running),is there any way to create service to stay alive after application closed or any way to add this option in java(android) inside ionic platform.
sorry for bad english :stuck_out_tongue:

3 Likes

up up up up up up up up up
any solution ?

Did you get any solution? cz I too am looking to implement such a thing

If the app is killed, and not even in background, your app can’t do anything, as it is not running.
So: not possible.

I want to get user’s location at a particular time of day even when the application is closed (its not even in background)… Is there any way I can achieve this?

If the app is closed, answer is as @Sujan12 said: not possible. You could however trigger a local notification, which on interaction let’s the user open up the app. Then you can do whatever you want. But it isn’t possible when the app is fully closed for obvious reasons. Else you could ask for a device location whenever you want, which could potentially be a huge privacy risk.

@karansharma

Maybe this plugin can help?

Did you get a solution for sending geolocation when app is in background?

Any updates on this? 7 Years later?
Also, with react-native is it possible?