gpt4 book ai didi

ios - ALAssetsLibrary 在保存到相册时询问用户许可吗?为什么?

转载 作者:行者123 更新时间:2023-11-28 17:35:19 25 4
gpt4 key购买 nike

我有一款游戏,用户可以在其中截屏并将其保存到以游戏命名的自定义相册中。当我尝试执行此操作时,iOS 会询问用户应用程序是否可以访问他们的位置信息,如果他们拒绝,则屏幕截图不会保存在自定义相册中,而是保存在默认相册中。

为什么要请求使用位置信息的许可?我只是在截屏。跟相机没关系。我只是复制 opengl 表面并从中制作 UIImage。

这就是我保存 UIImage 的方式:

- (void)writeImageToSavedPhotosAlbum:(CGImageRef)imageRef orientation:(ALAssetOrientation)orientation completionBlock:(ALAssetsLibraryWriteImageCompletionBlock)completionBlock;

是否将位置信息放入屏幕截图中?如果是这样,我可以禁用它以便不出现此警告吗?我的游戏不需要位置信息,我不希望用户认为我在跟踪他们。

这似乎是一个疯狂的警告,因为它完全不符合事实。

最佳答案

如以下链接所示, http://developer.apple.com/library/ios/#Documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/Reference/Reference.html

This method will fail with error ALAssetsLibraryAccessGloballyDeniedError if the user has not enabled Location Services (in Settings > General).

不过,我们发现在iOS 6中并没有位置权限请求,可能是iOS 6对Photos有其他的隐私控制。因此,您无需请求位置许可。我们的解决方案是检查 [[UIDevice currentDevice]systemVersion] 并仅在 iOS >= 6 时保存到自定义相册。

关于ios - ALAssetsLibrary 在保存到相册时询问用户许可吗?为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9969060/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com