(1)用户权限描述
为了保护隐私,最终用户必须明确的允许应用程序访问提醒信号、照片、位置、联系人、和日历数据。为了说服用户接受,它有助于解释应用程序可以怎样使用这类数据,并且说明访问他的原因。给位于Info.plist文件顶层的以下键分配字符串值。当iOS提示用户有关特定资源的权限时,他将显示这些字符串,作为他的标准对话框的一部分。
相册
NSPhotoLibraryUsageDescription
相册写入
NSPhotoLibraryAddUsageDescription
相机
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>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>NSMotionUsageDescription</key>
<string>App需要您的同意,才能访问运动与健身</string>
<key>NSRemindersUsageDescription</key>
<string>App需要您的同意,才能访问提醒事项</string>
<key>NSMicrophoneUsageDescription</key>
<string>此App会在拍摄视频时访问您的麦克风</string>
<key>NSCameraUsageDescription</key>
<string>App会在上传照片和头像时访问您的相机权限</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>App会在上传照片和头像时访问您的相册权限</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>App需要您的同意,才能保存图像和视频到您的相册</string>
(2)其他常用的Info.plist键
下面给出了你可能想在属性列表中分配的另外几个常用键,以及有关他们可以做什么的描述。
UIFileSharingEnabled(Boolean型,默认为关):允许用户从iTunes中访问应用程序的Documents文件夹中的内容。这个文件夹出现在应用程序沙盒的顶级。
UIAppFonts(Array型,字体名称(包括其扩展)的字符串):指定在软件包中提供自定义的TTF字体。再添加字体时,可以使用标准的UIFont调用访问他们。
UIApplicationExitsOnSuspend(Boolean 型,默认为关):当用户单击Home按钮时使应用程序能够终止,而不是退出到后台。当启用这个键时,当按下Home键时,会终止应用程序,并从内存中清除它。
UIRequiresPersistentWifi(Boolean型,默认为关):指示IOS在应用程序活动时维持一条Wi-Fi连接
UIStatusBarHidden(Boolean型,默认为关):如果启用这个键,则会在应用程序中启动时隐藏状态栏
UIStatusBarStyle(string 型,默认为UIStatusBarStyleDefault):指定应用程序启动时的状态栏的风格。
NSAppTransportSecurity(Dict型):添加NSAllowsArbitraryLoads(Boolean型)true表示允许http访问。