NSLocationWhenInUseUsageDescription warning, but I have already added it NSLocationWhenInUseUsageDescription warning, but I have already added it ios ios

NSLocationWhenInUseUsageDescription warning, but I have already added it


Adding both

NSLocationAlwaysAndWhenInUseUsageDescription

and

NSLocationWhenInUseUsageDescription

keys in plist solved my problem.

    <key>NSLocationAlwaysUsageDescription</key>    <string>Your location is required for xyz benefits for you</string>    <key>NSLocationWhenInUseUsageDescription</key>    <string>Your location is required for xyz benefits for you</string>


There are a ton of poorly structured frameworks (namely FirebaseMessaging)that use camera and location for no benefit to the user.You should alert end user this functionality is NOT needed for your application and user must NOT grant app access to that parasite inside.What a sad, sad times we live in.

    <key>NSLocationAlwaysUsageDescription</key>    <string>Your location is not needed. This request has popped up due to a 3rd party framework used by the app in a context that does NOT need you to reveal you location. Do be sure to check audit trail for the location queries on ios 15 or later.</string>    <key>NSLocationWhenInUseUsageDescription</key>    <string>You will get zero benefit allowing this app accessing your location. You should never see this alert. If you do alert technical support at foo@bar.baz</string>

Or otherwise do be crafty in the verbiage used to convey the exact usage and risks giving app access to anything outside its sandbox.


Well, actually, in my case I needed to put ALL THREE of them like this:

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key><string>...</string><key>NSLocationAlwaysUsageDescription</key><string>...</string><key>NSLocationWhenInUseUsageDescription</key><string>...</string>

Otherwise, I wouldn't get the pop-up alert asking to allow the Location.enter image description here

Note: I develop in Flutter, I don't know if it has any repercussions in this case...