pmwisdom / meteor-background-geolocation-services

Cordova Background Geolocation For Android and iOS with pure javascript callbacks
12 stars 12 forks source link

How to trigger native (modal) background geolocation prompt #10

Open Lekterx opened 7 years ago

Lekterx commented 7 years ago

Guess this is finally the good place to post this one, sorry for the spamming !

Hi, Thanks a lot for this great plugin ! It works perfectly on my app, except that the phone doesn't prompt the user to explain that myApp would like to use the user's geolocation all the time. Therefore, when the application is in background, I get a blue alert on top of screen saying thet myApp is "using geolocation data". I can get rid of this by going in my phone's setup, and allow background geolocation for myApp, but it's definitely not possible to request this from all my users.

So is there a way to trigger the iOS command tu allow background geolocation from my meteor app ?

Thanks a lot for your help on this (maybe stupid?) question !

pmwisdom commented 7 years ago

It should attempt to retrieve permissions when you start up your app with the plugin for the first time.

Lekterx commented 7 years ago

Thank you very much for your answer. It still doesn't asks for permission (it asks for permission to get location when the app is in use, but not for background, "all the time" location update). I have enabled "location updates" in the "Background modes" capabilities in Xcode, but when I remove it, the app just crashes, so I suppose the problem doesn't come from here. Or is there any known incompatibility with mdg:geolocation package (which I'm using for geolocation when the app is in foreground...) ?

Lekterx commented 7 years ago

Solved it ! It was as expected quite stupid from me... I also enabled the "background fetch" option in Xcode, and it worked... Thanks again for this great plugin and for your support !