Question

In iOS, is there a way to check if the user has not allowed access to the photos on app launch? I am working on an app that uses the photo albums heavily, really as a requirement or nearly so, and would like to be able to have a contingency if they decide not to allow access.

Was it helpful?

Solution

try [ALAssetsLibrary authorizationStatus] == ALAuthorizationStatusAuthorized

Make sure to include the "AssetsLibrary" framework in your project and add #import <AssetsLibrary/AssetsLibrary.h> to your file.

OTHER TIPS

Here is the Swift equivalent.

import AssetsLibrary

After importing, calling ALAssetsLibrary.authorizationStatus() returns either

NotDetermined

Restricted

Denied

Authorized

from the ALAuthorizationStatus enum.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top