Search code examples
iospermissionsphotobreakpointsprivacy

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!


Solution

  • 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];