As the question asks.
I'm looking for a guide on permissions. I've only developed for Android before and I was wondering if there was a guide similar to http://developer.android.com/guide/topics/security/permissions.html
I'm not entirely sure how permissions work (or if they're even called this on iOS 6).
You don't have permissions the way you do on Android, as in you must declare them some where on for hand.
When you, for example, start the locationmanager, the system will ask the user if your app is allowed to receive location updates. If the user does not allow this the the CLLocationManager will call the delegate that it could not retrieve any location updates.
There is also a methods on CLLocationManager called authorizationStatus to check the current status. This is an CLAuthorizationStatus.
Every other component will have a simulare kind of methods and error to check wether the user allows your app to acces data.
Related
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.
Should and event store's requestAccess(to:completion:) be called
as early as possible (e.g. in application(_:didFinishLaunchingWithOptions:)
only before EKEventSource should be used for the first time?
Does Apple recommend one or the other option (for iOS 10)?
Why nag the user any sooner than necessary?
A user will be more comfortable if the request for permission comes when they actually try to do something they know requires access to the event store.
If you request permission too soon, the user is going to wonder why the app is asking when they haven't even done anything with the app yet.
And what if your app needs access to multiple sources such as camera, photo library, contacts, and events? It would be terrible to just nag the user over and over for all of them up front. Only ask when the source is actually needed and the user probably fully understands that the action they just took (like take photo) requires the specific permission.
My application ask for location and notification permissions.
When user launch the app for first time the location request displays and after notification request displays.
Is there any way to request this better? Maybe an a list like in Android or anything better than I have right now?
You should generally only ask for permissions or check for authorisation when it is required by the app, and not when the user launches the app for the first time. For example, notification permissions could be requested at launch, but location permissions should be requested only when the data is required in your app.
As far as I know, there is no Android-like way to request for permissions.
Edit: You may want to check out third party libraries like ISHPermissionKit and JLPermissions, which provide a more unified approach to asking for user permissions, which is what you might be looking for. But ultimately, I still believe that asking for permission only when it is required is still the way to go.
When your app uses push notification, it will be the first to prompt to user for notification access. Notification Access Pop-Up will prompt at the very beginning of App Launch.
You can ask for location access permission on demand using - CLLocationManager requestWhenInUseAuthorization or AlwaysInUseAuthorization.
If you need to access Camera, Photo Library Access just add privacy usage on your info.plist and iOS will ask for permission accordingly on demand.
I am using core location framework to collect the device location in my iOS app. When i install the app for the first time in device, iOS asks for the user permission with a alert view as below.
Is there any way to disable this default alert view and display a customized message to the user?
I added screen shot where to add purpose message.
Those alerts are system generated and not editable by the developer. If they were editable, then the developer could change the meaning or make it not obvious to the end user what permissions they were asking for.
For user privacy reasons, this prompt/alert is system generated and you can't disable it if your app uses core location.
Having said that, however, you can delay the display of this alert in your app by organizing your code flow such that location services are only called when needed (lazy initialization).
As per apple docs, read notes under method -
+ (BOOL)locationServicesEnabled
Location services prompts users the first time they attempt to use location-related information in an app but does not prompt for subsequent attempts. If the user denies the use of location services and you attempt to start location updates anyway, the location manager reports an error to its delegate.
I've developed an app using a MapView - when the app starts up, it asks the user to allow their location to be accessed/used without any coding from me. Is this sufficient for permission or should I also specifically ask the user and provide a reason for the access? Will Apple reject the app on submission if I don't specifically make the request and allow the MapView to request this on my behalf?
You don't need to ask the user for permission, iOS does it for you automatically.
You should set the purpose string property in the CLLocationManager object so that when the system asks it can also tell the user why you want their location.
locationManager.purpose = #"Location needed to show zombies that are nearby.";
Set this property before calling startUpdatingLocation so that it gets shown to the user in the system alert that asks for permission to use location.
In the delegate you can implement the method locationManager:didChangeAuthorizationStatus: to know whether the user allowed core location or not.
As of iOS 6, the correct place for the "purpose" message is in the Info plist file.
The NSLocationUsageDescription property should be set with the message to display to users
Apple provides good documentation:
https://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html
You don't need to tell the user why their location is being accessed especially if the application is based on location and mapping. With that said it is nice to tell the user what exactly you will do with their data before the permission popup comes up so that hopefully more users will accept.