美文网首页
iOS设置Info.plist权限属性

iOS设置Info.plist权限属性

作者: 坤哥爱卿 | 来源:发表于2018-09-11 16:29 被阅读93次

为了保护隐私,最终用户必须明确的允许应用程序访问提醒信号、照片、位置、联系人、和日历数据。为了说服用户接受,它有助于解释应用程序可以怎样使用这类数据,并且说明访问他的原因。给位于Info.plist文件顶层的以下键分配字符串值。当iOS提示用户有关特定资源的权限时,他将显示这些字符串,作为他的标准对话框的一部分。

相册

NSPhotoLibraryUsageDescription

相机

NSCameraUsageDescription

麦克风

NSMicrophoneUsageDescription

位置

NSLocationUsageDescription

在使用期间访问位置

NSLocationWhenInUseUsageDescription

始终访问位置

NSLocationAlwaysUsageDescription

日历

NSCalendarsUsageDescription

提醒事项

NSRemindersUsageDescription

运动与健身

NSMotionUsageDescription

健康更新

NSHealthUpdateUsageDescription

健康分享

NSHealthShareUsageDescription

蓝牙

NSBluetoothPeripheralUsageDescription

媒体资料库

NSAppleMusicUsageDescription

<key>NSAppleMusicUsageDescription</key>

<string>App需要您的同意,才能访问媒体资料库</string>

<key>NSBluetoothPeripheralUsageDescription</key>

<string>App需要您的同意,才能访问蓝牙</string>

<key>NSCalendarsUsageDescription</key>

<string>App需要您的同意,才能访问日历</string>

<key>NSCameraUsageDescription</key>

<string>App需要您的同意,才能访问相册</string>

<key>NSContactsUsageDescription</key>

<string>App需要您的同意,才能访问通信录</string>

<key>NSHealthShareUsageDescription</key>

<string>App需要您的同意,才能访问健康分享</string>

<key>NSHealthUpdateUsageDescription</key>

<string>App需要您的同意,才能访问健康更新 </string>

<key>NSLocationAlwaysUsageDescription</key>

<string>App需要您的同意,才能始终访问位置</string>

<key>NSLocationUsageDescription</key>

<string>App需要您的同意,才能访问位置</string>

<key>NSLocationWhenInUseUsageDescription</key>

<string>App需要您的同意,才能在使用期间访问位置</string>

<key>NSMicrophoneUsageDescription</key>

<string>App需要您的同意,才能访问麦克风</string>

<key>NSMotionUsageDescription</key>

<string>App需要您的同意,才能访问运动与健身</string>

<key>NSPhotoLibraryUsageDescription</key>

<string>App需要您的同意,才能访问相机</string>

<key>NSRemindersUsageDescription</key>

<string>App需要您的同意,才能访问提醒事项</string>

相关文章

网友评论

      本文标题:iOS设置Info.plist权限属性

      本文链接:https://www.haomeiwen.com/subject/uzliiftx.html