Search code examples
iphoneiosphotos

Can I determine if user denied access to photos?


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.


Solution

  • try [ALAssetsLibrary authorizationStatus] == ALAuthorizationStatusAuthorized

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