I'm developing an app for iOS and Android using Xamarin where I need to use the user's location but the location permission isn't displaying on within the app settings.
I've added:
<key>NSLocationAlwaysUsageDescription</key>
<string>Description of usage</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Description of usage</string>
to my Info.plist file but it isn't showing the location settings in my app settings.
I've also added the permissions for Media Library and Camera and they're showing perfectly fine so I'm not sure why location is any different.
Per some advice online I've also tried re-installing the app and rebooting the device, but neither have changed what I'm seeing.
I'm testing this on iOS 12.3.1.
Thanks
From the document :
To access location services on iOS, you must set the following keys in Info.plist:
iOS 11
NSLocationWhenInUseUsageDescription – for using location services when the app is in use NSLocationAlwaysAndWhenInUseUsageDescription – for using location services at all times
iOS 10 and earlier
NSLocationWhenInUseUsageDescription – for using location services when the app is in use NSLocationAlwaysUsageDescription – for using location services at all times
To support iOS 11 and earlier, you can include all three keys: NSLocationWhenInUseUsageDescription
, NSLocationAlwaysAndWhenInUseUsageDescription
, and NSLocationAlwaysUsageDescription
.
See this thread for more information: location-services-not-working-in-ios-11
do not fight, just use this plug in
https://github.com/jamesmontemagno/PermissionsPlugin/issues/93
Turns out the problem is I'm just a moron.
I was using the Permissions Plugin and setting NSLocationWhenInUsageDescription, NSLocationAlwaysUsageDescription and NSLocationAlwaysAndWhenInUsageDescription but using PermissionsPlugin I was only checking Location, not LocationAlways and LocationWhenInUse.
Thanks to anyone who tried to help me.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.