Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 14: Allow Location Access | Always menu not found

I tried to run my project in Xcode 12 beta 2 with iOS 14 simulator. I observed "Always" menu is not found in Allow Location Access Setting screen.

enter image description here

I have given the followings info.plist

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>TEST APP</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>TEST APP</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>TEST APP</string>
like image 450
Sridhar Avatar asked Jul 10 '20 11:07

Sridhar


People also ask

Why does Apple always say location not available?

If a friend's location is not available on your iPhone, odds are that the issue is on your friend's phone, not yours. Ask your friend to make sure their phone is connected to WiFi or cellular, they're currently sharing their location, and that location services are enabled.

Why can't I enable my location on my iPhone?

From the Apple menu , choose System Preferences, click Security & Privacy, then click Privacy. Make sure that Enable Location Services is selected. If the lock in the lower-left corner is closed, click it, then enter your user name and password. Select the checkbox next to Maps.

How do I allow location access always?

Open your phone's Settings app. Under "Personal," tap Location access. At the top of the screen, turn Access to my location on or off.


1 Answers

The "Always Allow" option has been removed from the initial location permissions prompt. You can get this option later as a new prompt. Then the question comes, how will we support the location feature if we need it in the background?

enter image description here

Way to achieve this -

  1. Call the method "locationManager.requestAlwaysAuthorization()" before your app can receive location information. If your app needs always permission and you want to receive the prompt for always permission later.

  2. Initially, users can select "While Using the app" or select a new option, "Allow Once"(introduced in iOS 13 itself).

  3. If the user continues to use the app, iOS 13 will now automatically prompt to upgrade location permissions from "While Using the app" to "Always Allow".

    enter image description here

  4. You will receive #2 prompt next time after unlocking the device and launching the app with already grated "While Using the app" permission.

Source

This WWDC 2019 video also suggests that this is still possible: https://developer.apple.com/videos/play/wwdc2019/705/

At 6:57 "...you can request when in use authorization first, then, at some later point, when the user interacts with a feature of the app that warrants it, seek always authorization later..."

like image 62
Shashank Mishra Avatar answered Nov 06 '22 23:11

Shashank Mishra