一、权限声明
在应用.plist中添加APP使用权限的相应权限声明Key及描述string,如下所示:
<key>NSCameraUsageDescription</key>
<string>Please authorize</string>
<key>NSContactsUsageDescription</key>
<string>Please authorize</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Please authorize</string>
<key>NSMicrophoneUsageDescription</key>
<string>Please authorize</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Please authorize</string>
在对应权限的string里面不能为空,否则上传构建版本会失败。
二、国际化
1、创建InfoPlist.strings;
2、InfoPlist.strings 添加国际化;
在InfoPlist.strings(English)添加:
/*权限声明*/
NSCameraUsageDescription = "Used to open camera";
NSContactsUsageDescription = "Used to open contacts";
NSLocationWhenInUseUsageDescription = "Used to open location";
NSMicrophoneUsageDescription = "Used to open microphone";
NSPhotoLibraryUsageDescription = "Used to open photos";
在InfoPlist.strings(Chinese(Simplified))添加:
/*权限声明*/
NSCameraUsageDescription = "用于打开相机";
NSContactsUsageDescription = "用于打开联系人";
NSLocationWhenInUseUsageDescription = "用于打开定位";
NSMicrophoneUsageDescription = "用于打开耳机";
NSPhotoLibraryUsageDescription = "用于打开相册";
参考1:http://www.cnblogs.com/wobuyayi/p/5942793.html
参考2:http://blog.csdn.net/king_jensen/article/details/18523129