You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
iOS LocationAlways doesn't popup an iOS permission dialog with "Always" as an option. Plugin returns Granted but iOS settings shows "When In Use" (not Always)
#163
Open
RobbiewOnline opened this issue
Jan 7, 2020
· 3 comments
Version Number of Plugin: 3.0.0.12
Device Tested On:
Simulator Tested On: iOS Simulator (iOS 13)
Version of VS: 8.3.11 build 1 (Mac)
Version of Xamarin:Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)
Versions of other things you are using:
Version: 13.6.0.12 (Visual Studio Community)
Steps to reproduce the Behavior
Start from a clean simulator (Hardware -> Erase all contents and settings)
Run the code snippet below
Expected Behavior
Requesting 'When in use" should prompt a permission dialog
Requesting 'Always Use' should prompt a permission dialog
iOS App Settings should mirror requested permissions
Actual Behavior
Requesting 'Always Use' does NOT show an iOS permission dialog
iOS app Settings remain as "When in use" and doesn't show "Always"
Querying CheckPermissionStatusAsync(Permission.LocationWhenInUse) yields Granted which doesn't match iOS app settings
Code snippet
// Part 1 - check both permissions are 'unknown'
var locationWhenInUse = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.LocationWhenInUse);
var locationAlways = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.LocationAlways);
// Part 2 - Request 'WhenInUse'
var dict = await CrossPermissions.Current.RequestPermissionsAsync(Permission.LocationWhenInUse);
// Part 3 - Verify WhenInUse is granted
locationWhenInUse = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.LocationWhenInUse); // Granted
locationAlways = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.LocationAlways); // Denied
// Part 4 - Attempt requesting 'LocationAlways' - reports granted but not reflected in Settings -> App
dict = await CrossPermissions.Current.RequestPermissionsAsync(Permission.LocationAlways); // Returns Granted
locationWhenInUse = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.LocationWhenInUse);
locationAlways = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.LocationAlways); // Returns Granted
// Part 5 - repeat the above and step 1 will show granted for In Use and Always scenarios but iOS settings only for In Use.
I have also tried Permission.Location which auto-complete comments that it's the equivalent of LocationWhenInUse and LocationAlways, but still iOS doesn't prompt for the 'Always' permission, however if the app is collecting location data then eventually it does popup in the background which seems very late to ask for the allow always permission. Shouldn't it allow me to explicitly request it from the user before I start using it?
Debugging Screenshots
When reviewing the permissions the plugin says both LocationWhenInUse and LocationAlways are granted
But iOS settings doesn't concur
Re-running the app will yield granted for both in part 1
Summary
1 - Shouldn't requesting the LocationAlways permission explicitly ask the iOS user immediately? It currently asks after the app has been backgrounded for some time.
2 - Why doesn't iOS settings reflect the same as CheckPermissionStatusAsync(Permission.LocationAlways)
I'm not sure whether this library isn't invoking something correctly, or whether iOS doesn't present the user with the "Always" option unless the app has been running in the background for a while?
The text was updated successfully, but these errors were encountered:
RobbiewOnline
changed the title
iOS LocationWhenInUse v LocationAlways
iOS LocationAlways doesn't popup an iOS permission dialog with "Always" as an option, but says "Granted" when iOS settings only shows "When In Use" (not Always).
Jan 7, 2020
RobbiewOnline
changed the title
iOS LocationAlways doesn't popup an iOS permission dialog with "Always" as an option, but says "Granted" when iOS settings only shows "When In Use" (not Always).
iOS LocationAlways doesn't popup an iOS permission dialog with "Always" as an option. Plugin returns Granted but iOS settings shows "When In Use" (not Always)
Jan 7, 2020
The existing “Allow While Using App” option will grant location permissions to users in the foreground just as it has in the past. However, if an app’s developers have additionally requested that the app track background location, then selecting this option will additionally grant provisional “Always Allow” permissions. This means that the app is actually granted permission to request the user’s location data while the app is not actively visible on the screen for a short period of time. During this short period, Apple will be keeping track of that usage, and eventually will prompt the user with the following: “Keep Only While Using” or “Change to Always Allow.” The notice includes a customizable subtext explaining why the app needs “Always Allow” location permission and helps users understand why and how the location is used to deliver value
Bug Information
Version Number of Plugin: 3.0.0.12
Device Tested On:
Simulator Tested On: iOS Simulator (iOS 13)
Version of VS: 8.3.11 build 1 (Mac)
Version of Xamarin:Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)
Versions of other things you are using:
Version: 13.6.0.12 (Visual Studio Community)
Steps to reproduce the Behavior
Expected Behavior
Actual Behavior
Code snippet
I have also tried Permission.Location which auto-complete comments that it's the equivalent of LocationWhenInUse and LocationAlways, but still iOS doesn't prompt for the 'Always' permission, however if the app is collecting location data then eventually it does popup in the background which seems very late to ask for the allow always permission. Shouldn't it allow me to explicitly request it from the user before I start using it?
Debugging Screenshots
When reviewing the permissions the plugin says both LocationWhenInUse and LocationAlways are granted
But iOS settings doesn't concur
![](https://user-images.githubusercontent.com/18516600/71926422-30f81000-318b-11ea-8803-8d838c652308.png)
Re-running the app will yield granted for both in part 1
Summary
1 - Shouldn't requesting the LocationAlways permission explicitly ask the iOS user immediately? It currently asks after the app has been backgrounded for some time.
2 - Why doesn't iOS settings reflect the same as CheckPermissionStatusAsync(Permission.LocationAlways)
A useful link is https://medium.com/rakutenready/requesting-location-permissions-in-ios-9e5a3b814a8b which explains how the common approach is to request the "When In Use" location permission first and then ask the user to upgrade to "Use Always" as a later step.
I'm not sure whether this library isn't invoking something correctly, or whether iOS doesn't present the user with the "Always" option unless the app has been running in the background for a while?
The text was updated successfully, but these errors were encountered: