cordova-plugin-background-geolocation icon indicating copy to clipboard operation
cordova-plugin-background-geolocation copied to clipboard

close app, stop service

Open edgrod01 opened this issue 4 years ago • 7 comments

hi im using in ionic 4, when i close the app, this service end, i need that run this server ever, until the user want stop

thanks for your help

edgrod01 avatar Jun 07 '20 13:06 edgrod01

Forever is probably not possible since the OS can kill it due to battery optimization, but have you tried to set startForeground to true? It helped me when I needed it to run in the background for long period of time.

HarelM avatar Jul 09 '20 19:07 HarelM

@edgrod01 can you give some more information about your environment?

skibaalex avatar Jul 11 '20 19:07 skibaalex

why after closing app on ios the plugin stop working. in android this plugin works in background forever even if we close the app. thank you

muneebul avatar Jul 22 '20 14:07 muneebul

+1 have the same issue, on my android plugin works fine, but on ios after restarting app I check status of BackgroundGeolocation and have isRunning: false Image from iOS @HarelM, @skibaalex any solution? do you need any information? maybe I miss something? Thank you

dima83909 avatar Jul 22 '20 21:07 dima83909

From my experience the background location works differently in live environment after Apple approved the app. In my case the behavior was the same and I'm my case I could implement server side solution and after they approved it it worked like expected 🤷‍♂️

skibaalex avatar Jul 23 '20 04:07 skibaalex

I haven't fully tested it on iOS, but I haven't received any complains from my users so I guess it just worked for me... My location service wrapper can be found here: https://github.com/IsraelHikingMap/Site/blob/master/IsraelHiking.Web/sources/application/services/geo-location.service.ts Feel free to copy it :-)

HarelM avatar Jul 23 '20 05:07 HarelM

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 24 '21 03:01 stale[bot]