iOS9 微信支付支付宝支付适配

网上有相关文章,但不全,一方面是限制了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下都能正常使用

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值