iOS10 適配 權(quán)限

iOS 10對于隱私數(shù)據(jù)保護(hù)又一步加強(qiáng):

You must statically declare your app’s intended use of protected data classes by including the appropriate purpose string keys in your Info.plist file.

就是說在訪問用戶數(shù)據(jù)時(shí)都需要在Info.plist中進(jìn)行聲明,否則就崩潰。

需要聲明的數(shù)據(jù)權(quán)限如下圖所示:

iOS10 適配權(quán)限

常用的有: 通訊錄 媒體庫 相冊 相機(jī) 麥克風(fēng) 地理位置

在plist中加入字段之后如下所示:

<key>NSPhotoLibraryUsageDescription</key>

<string</string>

<key>NSCameraUsageDescription</key>

<string></string>

<key>NSMicrophoneUsageDescription</key>

<string></string>

Value字段可以為空, 如果有值會(huì)在獲取權(quán)限彈窗中顯示

注意: 在iOS10 正式發(fā)布之后 該字段Value不得為空,否則提交的構(gòu)建版本,在iTunesconnect上無法看見,同時(shí)接受到郵件:

We have discovered one or more issues with your recent delivery for "***". To process your delivery, the following issues must be corrected:

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

添加時(shí), 輸入 "Privacy"下部就會(huì)有所有的提示

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容