How to improve the User Expertience when asking the Location to the User?
I discovered this setting during the audit of the TikTok app. I was making an audit of all the parameters of the App?
AppScan.ai metric for NSLocationTemporaryUsageDescriptionDictionary
This parameter is detected in 1,6% (240 times in 15023 apps)of the App Scanned by AppScan.ai
NSLocationTemporaryUsageDescriptionDictionary definition
NSLocationTemporaryUsageDescriptionDictionary is a dictionary that is used in iOS applications to provide temporary location usage description strings to the user when requesting access to their device’s location services. This dictionary is used in conjunction with the requestTemporaryFullAccuracyAuthorization(withPurposeKey:completion:) method, which prompts the user for temporary access to their device’s precise location.
The dictionary contains one or more key-value pairs that describe the reason for the location access request. Each key represents a specific purpose for which the app requires the user’s location, and each value is a string that provides a brief description of why the app needs that information.
Here’s an example of how to use NSLocationTemporaryUsageDescriptionDictionary in Swift:
let temporaryUsageDescriptionDictionary: [String: String] = [ "MyApp needs your location to show nearby restaurants": "We use your location to provide restaurant recommendations near you", "MyApp needs your location to track your running progress": "We use your location to track your running route and distance" ] CLLocationManager().requestTemporaryFullAccuracyAuthorization(withPurposeKey: "MyAppLocationPurpose", completion: { error in if let error = error { print("Error requesting temporary location access: \(error.localizedDescription)") } else { print("Successfully requested temporary location access") } })
In the example above, we create a dictionary with two purposes for the app’s location usage, and then use the requestTemporaryFullAccuracyAuthorization(withPurposeKey:completion:) method to request temporary access to the user’s location with a specific purpose key. If the user grants temporary access, the app can then use the CoreLocation framework to access the user’s location for the specified purpose.
It’s important to note that temporary access to location services is only granted for a limited time and can be revoked by the user at any time. The app must request temporary location access each time it needs to access the user’s precise location, and provide a clear and concise description of why it needs that information.
NSLocationTemporaryUsageDescriptionDictionary improve User Experience
Providing a clear and concise description of why an app needs access to the user’s location can significantly improve the user experience in the following ways:
-
Builds Trust: By providing a detailed explanation of why an app needs access to the user’s location, the app can build trust with the user, which can help increase user engagement and retention.
-
Improves Transparency: When users are presented with a clear and concise explanation of why an app needs access to their location, it improves the transparency of the app’s usage of their data, which can help users make informed decisions about whether or not to grant location access.
-
Reduces Confusion: Providing a clear explanation of why an app needs access to the user’s location can reduce confusion and help users understand how their location data is being used within the app. This can help prevent users from accidentally granting access to their location when they don’t want to.
-
Enhances Relevance: By providing a specific purpose for location access, the app can better tailor its content and services to the user’s needs, making the user experience more relevant and personalized.
-
Promotes Privacy: Requesting temporary location access can help promote user privacy by limiting the app’s access to the user’s location data. This can help users feel more secure and in control of their personal data.