第三方登录适配iOS9

作者: Lonely__M | 来源:发表于2015-09-17 18:58 被阅读921次

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>```

至此结束。

相关文章

网友评论

    本文标题:第三方登录适配iOS9

    本文链接:https://www.haomeiwen.com/subject/peybcttx.html