Type Method

authorizationStatus

Returns information about your app’s authorization to access the user’s photo library.

Declaration

+ (PHAuthorizationStatus)authorizationStatus;

Return Value

The current authorization status. See PHAuthorizationStatus.

Discussion

Accessing the photo library always requires explicit permission from the user. 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.

After the user grants permission, the system remembers the choice for future use in your app, but the user can change this choice at any time using the Settings app. If the user has denied your app photo library access, not yet responded to the permission prompt, or cannot grant access due to restrictions, any attempts to fetch photo library content will return empty PHFetchResult objects, and any attempts to perform changes to the photo library will fail.

If this method returns PHAuthorizationStatusNotDetermined, you can call the requestAuthorization: method to prompt the user for photo library access permission.

See Also

Verifying Authorization

+ requestAuthorization:

Requests the user’s permission, if needed, to access the photo library.

PHAuthorizationStatus

Information about your app’s authorization to access the user’s photo library, used by the authorizationStatus and requestAuthorization: methods.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software