Display two different text for one permission - ios

I need to display two different messages for Privacy - Camera Usage Description permission based on the view controller user reaches first.
But I can only add one text in info.plist file.
For example if user first goes to viewController1, I need to show a text for permission and if user goes to viewController2, I need to show a different text. Is that possible?

The permission text is set in info.plist, so you cannot change it at runtime.
The permission dialog is only shown the first time that you request access to the camera, so it doesn't really make sense to have action specific permission requests; once permission is either granted or denied there are no further prompts shown to the user.
Your permission text should describe why you need access to the camera, perhaps mentioning both uses. Something like
MyGroovyApp needs access to the camera to create awesome selfies and to scan barcodes
Before requesting permission you could display an alert that explains why you are going to request permission. You can use whatever text you like in this alert.

Related

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.

Granting permission for the calendar without showing ios builtIn alertView

I am using this method to ask user for the calendar permission requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) but what i want is that when user clicks on Button named as GrantPermission, then the permission should be granted without showing the alertView which is of IOS builtin, is there any way to do this?
I want to do this because when user clicks on Dont Allow then i show a alertView which says that user have to manually turn on permission from settings and when user manually turns on this permission then the app crashes.
There is no way to grant permission without displaying the native alert view, as it provides an added level of security (without it developers would just be programatically granting permission to everything).
If you want to mitigate against getting into the situation where the user needs to manually grant permission from the Settings app you could display a "pre-permission" alert where you offer the user some information as to why they might want to allow it, followed by actually asking the system for permission which will in turn display the built in alert.
FWIW This isn't my idea, nor is it that new. This TechCrunch article goes into a lot more detail about the UX of asking for permissions on iOS.
Note that you could still end up in the situation where the user needs to manually grant permission - if they "accept" your alert but deny the actual system alert. In this case you will need to figure out why your app is crashing, maybe post another question regarding that.

"Access your photos" permission dialog showing up in wrong view

I am trying to change user's profile picture in IOS, in that the user can select a picture from gallery. But when I access the gallery using UIPickerController it asks for permission to access photos; but the permission alertview pops up on a different view in the app.
How can I always allow access to photos in my app or solve this pop up issue?
There is no way to programmatically force access to photos. Privacy issue!
if you want to access a users photos you HAVE TO ask him. there is no way around it. of course this has to happen only once. as soon as the user allows / denies the access the only way to change this setting afterwards is for him to go to the settings app and change the permission there.

iOS: how to prompt for user consent without clicking any button

I'm writing an app where a user can store a list of documents. When the user adds a new document whose name is already in the list, I'd like to prompt the user for her/his consent to replace the old document. I've looked at UIActionSheet but looks like it should be used when the user clicks some sort of button. UIAlertView is more like warning the user "The document will be replaced, no matter you like or not." So my question is: what's the best way in this case to prompt the user for consent?
Alerts can be used to ask the user to confirm an action. It is done all of the time. Simply implement the proper alert view delegate methods to respond to the user's choice.
Action sheets can be shown at any time with any need for a button to trigger such an event. The action sheet provides several options for displaying the action sheet.

If an iOS consumer denies permission to 'Use Current Location', is it technically possible to show the permission dialogue again?

My iOS app wants to display the users current location. Nothing special - but to do so, the first time the app is ran (or more to the point, the first time an MKViewMap in the app is displayed, I guess...) .. the user is asked for permission (which is awesome).
eg.
Now, if the user accidentally says DON'T ALLOW or decides to (later on) give permission ... is there technically a way we can reset their previous decision and when the app is restarted, ask them again automatically when the MKViewMap is next rendered again?
The user can enable or disable that option in the setting of the iphone. To do this, user have to select the Privacy option in the Setting Menu, and then select the Location Services option and than search the desired app to whom user want to enable or disable the permission and perform desired function by switching the toggle button on or off.
As it was a Private API provided from Apple the alert cannot be shown up again. Alternatively, we can check manually and show an alert like this.
The following can be read in the Apple docs:
"...it is recommended that you always call the locationServicesEnabled class method of CLLocationManager before attempting to start either the standard or significant-change location services. If it returns NO and you attempt to start location services anyway, the system prompts the user to confirm whether location services should be re-enabled. Given that location services are very likely to be disabled on purpose, the user might not welcome this prompt."
If I understand it right the alert will pop up everytime you try to get the users location, but it's not recommended to do so.
Link to full post:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html#//apple_ref/doc/uid/TP40009497-CH2-SW1
No you cannot do so. Rather than this, you can just check the latitude and longitude value and show alert to the user that enable the service from settings.

Resources