How may I check if my app has access to phone gallery

前端 未结 4 1427
伪装坚强ぢ
伪装坚强ぢ 2021-02-05 10:58

I have an app in which I take a picture with the camera and store that image into the native gallery. But if the app doesn\'t have permission for that, I want the user to know t

4条回答
  •  情深已故
    2021-02-05 11:46

    Note: iOS 6 Only

    Is this what you are looking for

    [ALAssetsLibrary authorizationStatus] == ALAuthorizationStatusAuthorized;
    

    Other values of authorizationStatus are

    ALAuthorizationStatusRestricted,        // This application is not authorized to access photo data.
                                                // The user cannot change this application’s status, possibly due to active restrictions
                                                //  such as parental controls being in place.
        ALAuthorizationStatusDenied,            // User has explicitly denied this application access to photos data.
        ALAuthorizationStatusAuthorized         // User has authorized this application to access photos data.
    

提交回复
热议问题