iOS 9适配系列教程:URL scheme

之前的项目中用到了友盟组件。在Xcode7下出现错误需要进行适配

URL scheme

在iOS9中,如果使用URL scheme必须在"Info.plist"中将你要在外部调用的URL scheme列为白名单,否则不能使用。key叫做LSApplicationQueriesSchemes ,键值内容是

<key>LSApplicationQueriesSchemes</key>

<array>

<string>urlscheme</string>

<string>urlscheme2</string>

<string>urlscheme3</string>

<string>urlscheme4</string>

</array>


 
 

推荐一篇博客: http://awkwardhare.com/post/121196006730/quick-take-on-ios-9-url-scheme-changes

其中最关键的是以下部分:

1
2
If you call the “canOpenURL” method on a URL that is not  in  your whitelist, it will  return  “NO”, even  if  there is an app installed that has registered to handle  this  scheme. A “This app is not allowed to query  for  scheme xxx” syslog entry will appear.
If you call the “openURL” method on a URL that is not  in  your whitelist, it will fail silently. A “This app is not allowed to query  for  scheme xxx” syslog entry will appear.

更多信息请移步:WWDC 2015 Session 703: "Privacy and Your App" 时间在30:18左右

blob.png

以下是几个常用分享需要添加的代码:
qq登录绑定,qq支付,qq分享,微信支付,微信登录绑定,新浪登录绑定支付宝支付,支付宝登录绑定

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>mqqOpensdkSSoLogin</string>
    <string>mqzone</string>
    <string>sinaweibo</string>
    <string>alipayauth</string>
    <string>alipay</string>
    <string>safepay</string>
    <string>mqq</string>
    <string>mqqapi</string>
    <string>mqqopensdkapiV3</string>
    <string>mqqopensdkapiV2</string>
    <string>mqqapiwallet</string>
    <string>mqqwpa</string>
    <string>mqqbrowser</string>
    <string>wtloginmqq2</string>
    <string>weixin</string>
    <string>wechat</string>
</array>加了15条 才实现


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值