iOS中info.plist文件的一些相关配置

下面是一些iOS项目中常用的plist文件的相关设置:

1.定位为题:

  调用定位时在target里设置两个属性:NSLocationAlwaysUsageDescription  NSLocationWhenInUseUsageDescription

2. 网络请求:

  Xcode升级后不支持http访问的解决办法:在Info.plist中添加NSAppTransportSecurity类型Dictionary。
    在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES

3. 设置应用名称(Bundle display name)
  <key>CFBundleDisplayName</key>
  <string>应用程序名称</string>

4.设置应用程序版本号(Bundle version):
  每次部署应用程序的一个新版本时,将会增加这个编号,用于标识不同的版本。
  <key>CFBundleVersion</key>
  <string>1.0</string>

5.设置应用程序是否支持后台运行(Application does not run in background)

  通过UIApplicationExitsOnSuspend可以设置iOS的应用程序进入到挂起状态下是否立即退出,设置为YES表示不支持后台运行退出到后台立即退出,设置为NO表示  支持后台运行。
  (1)设置支持后台运行
  <key>UIApplicationExitsOnSuspend</key>
  <false/>
  (2)设置不支持后台运行
  <key>UIApplicationExitsOnSuspend</key>
  <true/>

6. info.plist的几个常见属性:

  Localization native development region : 与本地化设置有关,为默认的开发语言
  Executable file:程序安装包的名称
  Bundle identifier:软件唯一的标识,是根据公司的标识与项目名称自动生成的,在上传和测试的时候会用到
  InfoDictionary version:版本信息
  Bundle name:App安装后显示的名称
  Bundle OS Type code:用来标识软件包类型
  Bundle versions string, short:发布的版本字符串
  Bundle creator OS Type code:创建者的标识
  Bundle version:应用程序版本号
  Application requires iPhone environment:用于指示程序包是否只能运行在iPhone OS 系统上,默认为YES
  Launch screen interface file base name:欢迎界面的文件名称
  Main storyboard file base name:默认情况下程序的主入口
  Supported interface orientations:设置程序默认支持的方向

原文地址:https://www.cnblogs.com/blogfan/p/5848645.html