网上有相关文章,但不全,一方面是限制了http访问,需要在info.plist中设置下:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
另一方面,是界面跳转,将要使用的URL Schemes设置为白名单:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>alipay</string>
<string>wechat</string>
<string>weixin</string>
</array>
这个微信的sdk 1.6更新了,其中说明文档有说到,支付宝暂没有找到。readme文件如下
重要!
SDK1.6
1、iOS 9系统策略更新,限制了http协议的访问,此外应用需要在“Info.plist”中将要使用的URL Schemes列为白名单,才可正常检查其他应用是否安装。
受此影响,当你的应用在iOS 9中需要使用微信SDK的相关能力(分享、收藏、支付、登录等)时,需要在“Info.plist”里增加如下代码:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
或者配置白名单域名pingma.qq.com
2、开发者需要在工程中链接上 CoreTelephony.framework
3、解决bitcode编译不过问题
另外,微信支付demo中有用到libsqlite3.dylib和libz.dylib,但是在xcode 7.0中找不到了,参考stackoverflow上的方法添加,能正常编译(因为之前找不到文件标红,我删了后编译不通过),见链接:http://stackoverflow.com/questions/30815806/swift-2-ios-9-libz-dylib-not-found
I had the same problem. I found some kind of way around.
Go to Build Phases >Link Binary with Librairies > + > Add other
Once in the file selection window do "CMD"+Shift+G (Go to folder) and type /usr/lib/
From /user/lib you can add : libz.dylib and more...
Compile and have fun
大概就是这样啦,现在支付宝和微信支付在iOS 9.0下都能正常使用