app 适配 iOS9

来源:互联网 发布:新西兰生活 知乎 编辑:程序博客网 时间:2024/06/11 07:34

最近提交应用到苹果商店,适配了iOS9,记录下(若有写的有误的请指点)


1、如果你的app中用到第三方平台的sdk,例如分享,请更新最新该平台发布的支持iOS9的sdk。否则在提交app二进制文件到AppStore时报相关的.bundle错误。例如:



网上还有其他的说法,如果该平台的sdk还没有更新到支持iOS9的话,可把sdk中bundle里的info.plist删除可以解决问题。


2、iOS9之后默认使用https请求,但大部分的小公司主要还是以http请求为主,所以需适配开发的app支持http请求

 比较简单粗暴的方法设置app支持所有http请求

 在info.plist里添加

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key>

<true/>

</dict>

3、iOS9使用URL scheme时必须也引入相应的白名单(来源:http://www.tekuba.net/program/364/)

   在info.plist中添加

<key>LSApplicationQueriesSchemes</key>

<array>

<string>weixin</string>

<string>wechat</string>

<string>mqqapi</string>

<string>mqq</string>

<string>mqqOpensdkSSoLogin</string>

<string>mqqconnect</string>

<string>mqqopensdkdataline</string>

<string>mqqopensdkgrouptribeshare</string>

<string>mqqopensdkfriend</string>

<string>mqqopensdkapi</string>

<string>mqqopensdkapiV2</string>

<string>mqqopensdkapiV3</string>

<string>mqzoneopensdk</string>

<string>wtloginmqq</string>

<string>wtloginmqq2</string>

<string>mqqwpa</string>

<string>mqzone</string>

<string>mqzonev2</string>

<string>mqzoneshare</string>

<string>wtloginqzone</string>

<string>mqzonewx</string>

<string>mqzoneopensdkapiV2</string>

<string>mqzoneopensdkapi19</string>

<string>mqzoneopensdkapi</string>

<string>mqzoneopensdk</string>

<string>sinaweibohd</string>

<string>sinaweibo</string>

<string>sinaweibosso</string>

<string>weibosdk</string>

<string>weibosdk2.5</string>

<!--支付宝回调-->

<string>alipay</string>

<string>alipayshare</string>

  • alipayshare

</array>

4、在编译app是提示xxx does not contain bitcode.(来源:http://www.cocoachina.com/ios/20150818/13078.html)

bidcode:bitcode是被编译程序的一种中间形式的代码。包含bitcode配置的程序将会在App store上被编译和链接。bitcode允许苹果在后期重新优化我们程序的二进制文件,而不需要我们重新提交一个新的版本到App store上。当我们提交程序到App store上时,Xcode会将程序编译为一个中间表现形式(bitcode)。然后App store会再将这个botcode编译为可执行的64位或32位程序。对于iOS应用:bitcode是可选的,watchOS:bitcode是必选的,Mac OS不支持bitcode

运行时的错误提示:You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64。
要么让第三方库支持,要么关闭target的bitcode选项。

在xcode7,bitcode默认是开启,如果第三方库不支持bitcode的话,就把bitcode设置NO,编译可通过。

bitcode禁用步骤:

target-->Build Settings-->Enable Bitcode  
设置其为NO即可


最后还有个疑问:打包上传的二进制文件,在iTunes Connect中带有感叹号,不知是不是禁用Bitcode的关系,知道其原因的大神指点下呗

0 0
原创粉丝点击