ios - Ask for multiple permissions - ios

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.

Related

Can I get location access without generating the default popup in iphone?

I am working on an app that requires location access. I created a view controller asking the user to allow or not with 2 buttons. But when I click the allow button, device is generating it's own popup asking the user for location access. Can I avoid the popup and just add the functionality of allow in popup into my code for the allow button in my app itself?
No you cannot avoid system popup. As per apple
Always request authorization at the point where you actually plan to
use location services to perform a task. Requesting authorization may
display an alert to the user. If it is not clear to the user that your
app is using location services for a useful purpose, the user may deny
your request to use those services.
Also, It is safe to start location services before the authorization status of your app is determined. Although you can start location services, those services do not deliver any data until the authorization status changes to authorizedAlways or authorizedWhenInUse. To be notified when the authorization status changes, implement the locationManager(_:didChangeAuthorization:) method in your location manager delegate.
Sorce
No, Not possible in Apple device yet.

Solution for apple's objection&rejection on our GPS based app?

We are developing an app that share user location on the map when they login and others can tap on their profile pic on map and start chatting with them .
Apple rejected the app with following reply :
"17.1 - Apps cannot transmit data about a user without obtaining the user's prior permission and providing the user with access to information about how and where the data will be used.
Upon further review, we found that your app enables the display of nearby users’ locations on a map but only prompts users on sign up or sign in for permission to show their location. If the user has signed in and previously agreed, then they are not prompted again until they log out. This is not appropriate for the App Store.
Specifically, it is not appropriate to display the user's location automatically without the option to decline if they have already signed in to access your app." We already tried to add multiple popup/confirm boxes for user permissions. what should be done to take care of this privacy issue ?
Should we add a button to manually checkin , everytime they want to update thier location ? this will defeat the purpose though if they have to click a button to update location to show where they are .
Or
Should we ask for permission to Show location each time App is opened since apple's objection is that it don't ask for permission again untill user is logged out and log in back ?
This is a speculative answer, since Apple has somewhat fuzzy replies, but this is my view:
Specifically, it is not appropriate to display the user's location automatically without the option to decline if they have already signed in to access your app."
You could solve it by:
* Sending a push notification when the user's location is being used (this could be annoying depending on app usage of location)
* Showing some info in a very visible place in the app, e.g. in the lateral menu, along with the option to reject to share your location (or otherwise, tell the user there that they can do so by logging out)
There must be other possible solutions, since the reviewer is a human being and the guideline broad and unspecific enough... But I think any of these options would work.

Access photos with AssetLibraryPhotosViewer

I'm trying out this code: http://github.com/akpw/AssetLibraryPhotosViewer to access photos on my iPhone.
However when I run the application, I get an alert that says the application is trying to access my photos - and then I can allow this or decline.
Can I disable this when using the AssetLibrary, or does this message always appear?
If I can't turn this off, and I press "Don't Allow", can I still make the app access my photos?
Following on from answer above. This will appear once. If you allow access then it will not show again and you will have access to the photo's. If you disallow it then you will not be allowed to access this and the alert dialog will not appear again.
This permission can be changed at any time by the user in the settings app (Under Location and Privacy, or a variation of that.) This has been around since iOS 6 I believe.
You are never able to programtically state that access has been granted, the system handles the permissions which are shown to the user.
This is a security feature of the OS that cannot be disabled. If a user does not give your app permission to access the photo library your app will not be able to access any photos. Given this ability your app should be able to handle the situation gracefully from a UI/UX perspective.
For more information take a look at this guide from Apple about iOS security guidelines (page 47 takes about accessing personal data) iOS Security

iOS Core-location: How to disable the default iOS pop-up message for user permission

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.

Asking user permission for accessing their location with iOS when mapView does

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.

Resources