iOS photo permissions to ask for second time

笑着哭i 提交于 2019-12-19 10:51:03

问题


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.


回答1:


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



回答2:


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.



来源:https://stackoverflow.com/questions/13969544/ios-photo-permissions-to-ask-for-second-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!