iOS photo permissions to ask for second time

后端 未结 2 1223
死守一世寂寞
死守一世寂寞 2021-01-16 07:35

I am currently using alasset which asks for permission for first time. If want to pop permission second time or every time when user has blocked it, how it is possible.

相关标签:
2条回答
  • 2021-01-16 08:21

    That dialog isn't controlled by the app, so no API for that.

    You can reset things as a user in the settings app (IIRC) but no programmatic way.


    To get the current authorization status:

    [ALAssetsLibrary authorizationStatus];
    
    (+ (ALAuthorizationStatus)authorizationStatus)
    

    Also, methods to get assets taking access error blocks, e.g.:

    - (void)assetForURL:(NSURL *)assetURL
            resultBlock:(ALAssetsLibraryAssetForURLResultBlock)resultBlock
           failureBlock:(ALAssetsLibraryAccessFailureBlock)failureBlock
    
    0 讨论(0)
  • 2021-01-16 08:34

    there is no way to show the permission prompt the second time.

    The best way to handle the permission prompt is that you should explain to the user before triggering the permission prompt (read: call method in the AssetsLibrary framework). If the user still click on "Don't Allow", then you should tell the user how can he/she grant the permission via the Settings app as you cannot invoke the prompt for the second time.

    0 讨论(0)
提交回复
热议问题