Type Method

requestAuthorization:

Displays a user interface so that the user can authorize whether your app may view the media library's contents.

Declaration

+ (void)requestAuthorization:(void (^)(MPMediaLibraryAuthorizationStatus status))handler;

Parameters

handler

A block that is called after the user choses whether to authorize the app.

status

The status chosen by the user.

See Also

Getting the Default Media Library

+ authorizationStatus

Returns whether the app can access the user's media library.

MPMediaLibraryAuthorizationStatus

The list of possible states for authorization to access to the user's media library.

+ defaultMediaLibrary

Returns an instance of the default media library.

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