ALAssetsLibrary ALAssetsLibraryAccessUserDeniedError
当您第一次尝试访问用户的 ALAssetsLibrary 时,操作系统将向他们显示一个对话框,请求许可。如果他们不允许这样做,则会调用 failureBlock,并且将来始终会调用。有没有办法再次强制提示此授权请求?
我注意到在地图应用程序中,它们通知用户转到“设置”应用程序以使用按钮打开位置服务。但是,据我所知,无法以编程方式打开“设置”应用程序。我应该只显示如何打开定位服务的说明吗?
When you first try to access a user's ALAssetsLibrary, the OS will present them with a dialog asking for permission. If they do not allow this, a failureBlock will be called and will always be called in the future. Is there a way to force a prompt of this authorization request again?
I notice in the Maps app, that they inform the user to go to the Settings app to turn on location services with a button. However, there is no way that I know of to programmatically open the Settings app. Should I just display directions as to how to turn on the location services?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法以 Apple 批准的方式打开设置应用程序。
您所能期望的最好结果是捕获错误,然后显示 UIAlertView 或其他视图,并提供有关如何执行此操作的说明。查看最新版本的 Dropbox 应用程序,了解他们如何指导用户。
You can't open up the settings app in an Apple approved manner.
The best you can hope for is to trap the error and then display a UIAlertView or other view with instructions on how to do this. Take a look at the latest v. of the Dropbox app for an idea on how they instruct the user.
当您尝试从代码访问库时,您可以使用错误处理程序来捕获错误并向用户显示一个警报,指定要执行的操作。
示例
When you try to access the Library from your code, you can use the error handler to catch the error and display an alert specifying to the user what to do.
Example