-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove CheckAlwaysPermissions call in iOS 13 and above #328
Conversation
Hi, I experienced an issue with this permission check as well. I'm porting a location-tracking iOS app to Xamarin.Forms. In my experience, and from my reading of apple's docs, what you described has been the behavior of "Always" vs "When In Use" all along, not just iOS13. So I'd propose the fix here is to only require "Always" permission if you're using StartMonitoringSignificantLocationChanges. To use "StartUpdatingLocation" you should only need "When in Use" permission regardless of whether background is enabled. I raised an issue #329 for what I've described, here's a PR: #330 |
didn't find older docs but based on this post it seems always and when in use works as I described. StartMonitoringSignificantLocationChanges is a type of setting for the location update frequency, I think. If this is true, StartMonitoringSignificantLocationChanges should work both in always and when in use. Btw we use the lib with this modification, so if something wrong with this approach, we have an issue to fix :) |
@Csaba8472 I also encountered the same Problem as you and your solution works for iOS 13. But I get a problem with iOS 14 when setting the Location permission "Manually" in the iOS Settings to "While Using the App" (when setting it via the Request-Permission-PopUp it works fine!). The problem is that the Plugin does not recognize that it has the "WhenInUse"-Permissions and tries to request permissions but the PopUp never appears (maybe because the system knows that the permission already are granted...). Everytime the |
sorry for the late answer, tested it and it works without the error message. The difference could be that we check and request permissions with Xamarin.Essentials. |
Yeah, that will be it. We eventually did a lokal Fork of the Project and replaced the usage of the Permission-Plugin with some Xamarin-Essentials Permission handling...But thanks for your answer anyway ;-) |
@Csaba8472 I was misinterpreting the ListenForSignificantChanges service, I thought that had to do with region monitoring. I'm going to close my PR. However I still think there's an unresolved issue with the permission check. Here is an explanation of When in Use vs Always from the apple (italics mine) https://developer.apple.com/documentation/corelocation/choosing_the_location_services_authorization_to_request
"When In Use" permission is sufficient to start So I feel like this plugin should either:
|
Fixes #289
Before iOS13 Always meant foreground + background but from iOS13 always means when the app is running(foreground+backgorund) + app is not running(e.g.: app uses geofences)