kerd
kerd

Reputation: 307

What triggers Photo Library authorization request? iOS

Is there a way to find what triggers Photo Library authorization request?

I can't find what line exactly triggers the permission request for Photo Library.

I've searched workspace for [PHPhotoLibrary requestAuthorization] - no luck.

What should I search for to find line that triggers Photo Library authorization request?

Device is on iOS 9.

Upvotes: 1

Views: 513

Answers (2)

kerd
kerd

Reputation: 307

So, it was [[PHCachingImageManager alloc] init]. This line calls for permission.

Upvotes: 3

Jim
Jim

Reputation: 73936

If you read the documentation for requestAuthorization:, you'll see:

The first time your app uses PHAsset, PHCollection, PHAssetCollection, or PHCollectionList methods to fetch content from the library, or uses one of the methods listed in Applying Changes to the Photo Library to request changes to library content, Photos automatically and asynchronously prompts the user to request authorization. Alternatively, you can call this method to prompt the user at a time of your choosing.

Upvotes: -1

Related Questions