iOS 9 添加白名单

iOS9的URL Scheme 需要设置白名单,否则无法打开,步骤如下:

首先更新第三方库的sdk

1.找到项目的info.plist文件 右击 选择 open as source code

2.添加如下配置:(针对qq,微信,微博,其他的URL Scheme 需要自己去找)

<key>LSApplicationQueriesSchemes</key>
    <array>
        <string>sinaweibohd</string>
        <string>sinaweibo</string>
        <string>weibosdk</string>
        <string>weibosdk2.5</string>
        <string>wechat</string>
        <string>weixin</string>
        <string>mqq</string>
        <string>mqzone</string>
        <string>wtloginmqq2</string>
        <string>mqqopensdkapiV3</string>
        <string>mqqopensdkapiV2</string>
        <string>mqqwpa</string>
        <string>mqqOpensdkSSoLogin</string>
    </array>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>sina.cn</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>weibo.cn</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>weibo.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
        </dict>
    </dict>

原文

posted on 2016-01-27 14:50  时光机728  阅读(457)  评论(0编辑  收藏  举报

导航