How to clarify the purpose of its use in the location modal? - ios

in my app i am showing user location on the map view So I implemented CLLocationManager. I got below error with Binary Rejected
.
4.5 - Apps using background location services must provide a reason that clarifies the purpose of the use, using mechanisms described in the Human Interface Guidelines
4.5 Details
Your app uses background location services but does not clarify the purpose of its use in the location modal alert as required in the iOS Human Interface Guidelines.
We’ve attached screenshot(s) for your reference.
Next Steps
Please reconfigure the UIAlertControllerStyleAlert in your code and specify the intended purpose of using background location in its message field.

You have to write description with NSLocationWhenInUseUsageDescription And NSLocationAlwaysUsageDescription this key in info.plist, so that user know that why your app is using gps location.
Both of the key take string as a value. and this string shows in GPS permission alert.
Add in info.plist as below.

Related

Google Maps asking for NSLocationWhenInUseUsageDescription

I have an iOS app that uses the Google maps library which I have added via CocoaPods. This app fetches user location even in background so it asks the user for NSLocationAlwaysUsageDescription.
But upon running the app from Xcode, I get the correct permission alert but I also get the following error message in the console.
This app has attempted to access privacy-sensitive data without a
usage description. The app's Info.plist must contain an
NSLocationWhenInUseUsageDescription key with a string value explaining
to the user how the app uses this data
Doesn't NSLocationAlwaysUsageDescription automatically allow when in usage as well? Because I don't want the When In Use option to be available in the Settings because if the user later changes to that, it will cause the app to behave not as intended.
You have to add a key value pair of NSLocationAlwaysUsageDescription as key and value is like you have to notify user , or something else that user can understand that this app is going to use gps location.
You can try this or add this in your plist
Privacy - Location Always Usage Description as key and
Application would like to use your location. By allowing background locations, we can notify you when a customer is requesting for service. Continued use of GPS running in the background can dramatically decrease battery life as value

Are location permissions somehow auto included in Adobe AIR for iOS?

In my application I include a 3rd party SDK which has the capability of asking for background location permissions. However I do not want this feature or the permissions popup in my app. From what I can tell this should be as simple as not including the NSLocationAlwaysUsageDescription in my plist.
As per Apple's documentation on NSLocationAlwaysUsageDescription:
This key is required when you use the requestAlwaysAuthorization method of the CLLocationManager class to request authorization for location services. If this key is not present and you call the requestAlwaysAuthorization method, the system ignores your request and prevents your app from using location services.
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW18
However the app clearly is capable of calling for permissions as the popup still shows when utilizing the SDK. When using the SDK in a non-AIR test app I do not have this issue.
Ideally I am looking to prevent these popups as this SDK is integral to the product. How can I tell AIR not to include this capability?
No, location permissions are not auto included with the AIR SDK.
The NSLocationAlwaysUsageDescription key is a requirement, it is not the element that initiates the location permission.
This is also a new requirement, so for older iOS versions this does not apply.
It sounds like your third party SDK is the issue, perhaps contact the developers and enquire with them.

Overriding iOS Settings UI - Apple rules

As in many apps, also in my app I have a "Settings" view.
I would like to add an item composed by text + UISwitch in order to give user possibility to change the "location services" permissions: when switch is enabled "allow location services: always", when is disabled "allow location services: never".
Question is: could this a reason for an Apple App Rejection?
I read all guidelines but I can't find an answer to my question.
Links
Review rejections.
Review guidelines.
UI Tips.
Regardless of app store review, what you're thinking of doing isn't technically possible. Your app can only request location permissions, it can't then tell the system that it doesn't need them any more.
For the user to amend location permissions they have to open the iOS settings app and go to the page for your app. You can provide a link from within your app to do this, using the UIApplicationOpenSettingsURLString constant to build and open a URL.
I don't know your code so I'll try to help you writing a few lines to follow to understand Apple reject.
So the first thing you need to do is to add one or both of the following keys to your Info.plist file:
NSLocationWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
Next you need to request authorization for the corresponding location method, WhenInUse or Background. Use one of these calls:
requestWhenInUseAuthorization
requestAlwaysAuthorization
Location types that you need Always authorization to use:
Significant Location Change
Boundary Crossing (Geofences)
Background Location Updates (e.g. Fitness, Navigation apps) iBeacons
Visited Locations (iOS 8+)
Deferred Location Updates

show custom view for iOS location permission dialog

I am new to iOS. Is it possible to show a custom view or dialog in place of the default iOS location permission dialog?
No, this dialog is presented by the operating system and you cannot modify it. It is an important part of privacy management that the dialog is presented in a consistent way for all apps and that apps cannot modify the permission process.
You can display a custom view or alert prior to requesting permissions that explains what is happening and the need to click "allow" on the alert that is about to be presented
Direct Answer is it's not possible
explanation :
Only option is set description string by using Cocoa Keys(The keys associated with the Cocoa touch environments)
Add one of these key to
NSLocationWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
Info.plist and set it's value to whatever which describe the purpose of getting location
ex:
MyApp picks you up from where you are. To book airport rides, choose “Allow” so the app can find your location.
Important: To protect user privacy, an iOS app linked on or after iOS 10.0, and which accesses the user’s location information, must statically declare the intent to do so. Include the NSLocationAlwaysUsageDescription key in your app’s Info.plist file and provide a purpose string for this key. If your app attempts to access the user’s location information without a corresponding purpose string, your app exits.
If you looking for localization for that message
Link

Customize default current location alert message (iOS)

Is it possible to customize the default alert message when the iPhone wants to use users current location. I want to change not only the text but also the default blue screen alert view. Is it possible ?
Thanks.
Not possible. From documentation,
Important: In addition to hardware not being available, the user has
the option of denying an application’s access to location service
data. During its initial uses by an application, the Core Location
framework prompts the user to confirm that using the location service
is acceptable. If the user denies the request, the CLLocationManager
object reports an appropriate error to its delegate during future
requests. You can also check the application’s explicit authorization
status using the authorizationStatus method.
The alert is prompted by Core location framework. We don't have any control over it.
EDIT : To add up, from this Apple developer forum thread (login required)
That alert is shown in a standard fashion for all applications for
privacy reasons. The user's current location is sensitive
information, and we want to be sure that they give their informed
consent to any use of it on the device. The way that we do that is by
providing a clear, consistent mechanism for the user to give their
consent. If applications were allowed to override or disable the
alert, then that consistency would be lost.
and the answerer is an Apple employee..
Years later, Apple did implement some customization options!
Have a look at the documentation
documentation
If you put one of the following key in your info.plist (depending on your usage of the location services), you can specify a custom string, that is displayed in the default alert additionally.
NSLocationUsageDescription (available since iOS6)
NSLocationWhenInUseUsageDescription (since iOS8)
NSLocationAlwaysUsageDescription (since iOS8)

Resources