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

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.

Related

Requesting photo access from preview on iOS

When opening images using presentPreviewAnimated: share menu contains "Save Image" option. It works fine if user gave access to photos before (and if user explicitly disabled access there's no such option at all), but otherwise app crashes. I can check permission before opening file, but it would be wrong if the user doesn't need to save it.
How can I check if user wants to save image and permission request is needed?
Solved by adding NSPhotoLibraryAddUsageDescription to plist, thanks to this post.

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.

Why user will be asked for access photo permission when first launch app?

When the app is first run it asks for permission to access the photos!
What's the reason for that?
One way is run the code one line by one line or Another way is revert code to previous version.
And find from which version, the app become to ask permission at first launch.
Previously, when we enter select photo screen, we would write code to ask the permission.
I also try to add symbolic breakpoints like:
-[UIAlertView initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:]
And even find a class dump UIAlertView header in order to add symbolic breakpoint but not work. Add UIAlertController breakpoint also does not work.
The simulator OS is 8.3. And each time I must reset contents and setting to reproduce the issue.
Any hint or good idea will be appreciated!
Finally, I find out the following code cause the iOS system to pop up the "Allow our App to access their photo gallery" dialog. Thanks for Vijay's answer.
[[PHPhotoLibrary sharedPhotoLibrary] registerChangeObserver:self];
Starting with iOS 6, Apple now requires apps to get explicit user permission before accessing Contacts, Calendars, Reminders, and Photos. From the "Data Privacy" section in Apple's iOS 6 Release Notes:
In addition to location data, the system now asks the user’s permission before allowing third-party apps to access certain user data, including:
Contacts
Calendars
Reminders
Photo Library
For contact, calendar, and reminder data, your app needs to be prepared to be denied access to these items and to adjust its behavior accordingly. If the user has not yet been prompted to allow access, the returned structure is valid but contains no records. If the user has denied access, the app receives a NULL value or no data. If the user grants permission to the app, the system subsequently notifies the app that it needs to reload or revert the data.

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 6 - Can't gain access to photos?

http://developer.apple.com/library/ios/#releasenotes/General/WhatsNewIniPhoneOS/Articles/iOS6.html
In there it says "For the photo library, the existing interface supports the app being denied access." Does it mean that there is no way for the app to ask the user permission to access his photos? He'll need to manualy go to settings -> privacy -> Photos and toggle my app?
If you are using ALAssets to get access to photo library, for the first time system will ask user if he want's to share photos to your app. If user taps "Allow" - everything will be ok, otherwise, user should go to the preferences and allow it manually when he wants.
Hope it helped
No, that not true. iOS will ask user for persmission when he first time accesses his photos from your app.

Resources