Closed kevinlafata closed 3 years ago
Hi @kevinlafata. I ran some tests and interestingly I am not seeing the 'always' option on either iOS or Android 10 in the example or on a separate app. I don't have an answer for you unfortunately but I guess in the interim you could add your own permission check for 'always' prior to calling startLocationService
eg
if (await Permission.locationAlways.status != PermissionStatus.granted){
await Permission.locationAlways.request();
}
As per Google Documentation, after Android O you need to ask permissions by increments. Which means first you must ask for Permission.locationWhenInUse and then for Permission.locationAlways
All permission handling should be done now on your side and has been removed from the plugin. The example app will be updated to reflect the change soon
I think I must be missing a bit of magic, I am seeing slightly different behavior in the example application vs trying to write a basic background location app. I was not seeing this issue a couple of weeks ago.
Downloading and running the (background_location) example application on an Android emulator (and phone) pops up a permission box I think at the point where startLocationService is called. The options include Allow all the time, Allow only while using the app, and Deny. This is the behavior I was expecting to see for background notifications.
If I do a flutter create, using 0.4.0, and use the same code (I think), my pop up permission box only has the last two options. I tried to remove all other differences/factors that I can find between the two versions of the app.
Am I missing some Android specific magic to add/configure that isn't documented ?
BTW I tried two different configs in the AndroidManifest.xml (the documentation was inconsistent with that was in the example app)
The example app does not seem to call any of the getPermission methods either.
Call to start:
ElevatedButton(onPressed: () { print("b2 pressed");
This is on Android Version 10
BTW, I can change the location permission to Always Allow in the Settings for the App. (ver 11 behavior).
How is the example app getting the Always Allow permission right off the bat?