分享白名单


http://dev.umeng.com/social/ios/ios9


1.  HTTP传输安全

以iOS9 SDK编译的工程会默认以SSL安全协议进行网络传输,即HTTPS,如果依然使用HTTP协议请求网络会报系统异常并中断请求。目前可用如下两种方式保持用HTTP进行网络连接:

A、在info.plist中加入安全域名白名单(右键info.plist用source code打开)

<key>NSAppTransportSecuritykey>
<dict>
    <key>NSExceptionDomainskey>
    <dict>
        <key>log.umsns.comkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoadskey>
            <true/>
            <key>NSTemporaryExceptionMinimumTLSVersionkey>
            <string>TLSv1.1string>
        dict>
        <key>sns.whalecloud.comkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoadskey>
            <true/>
            <key>NSTemporaryExceptionMinimumTLSVersionkey>
            <string>TLSv1.1string>
        dict>

        
        <key>sina.cnkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        <key>weibo.cnkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        <key>weibo.comkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSThirdPartyExceptionAllowsInsecureHTTPLoadskey>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        <key>sinaimg.cnkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSThirdPartyExceptionAllowsInsecureHTTPLoadskey>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        <key>sinajs.cnkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSThirdPartyExceptionAllowsInsecureHTTPLoadskey>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        <key>sina.com.cnkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSThirdPartyExceptionAllowsInsecureHTTPLoadskey>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        

        
        <key>qq.comkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSThirdPartyExceptionAllowsInsecureHTTPLoadskey>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        

        
        <key>renren.comkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSThirdPartyExceptionAllowsInsecureHTTPLoadskey>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        

        
        <key>facebook.comkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>                
            <key>NSExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        <key>fbcdn.netkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        <key>akamaihd.netkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>
            <key>NSExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        

        
        <key>twitter.comkey>
        <dict>
            <key>NSIncludesSubdomainskey>
            <true/>                
            <key>NSExceptionRequiresForwardSecrecykey>
            <false/>
        dict>
        
    dict>
dict>

注:以上部分平台官方未给出相应白名单,由技术人员测试各个平台所收集而来,如果有所遗漏,请自行加入并向客服说明,我们会进一步补充名单。

B、在info.plist的NSAppTransportSecurity下新增NSAllowsArbitraryLoads并设置为YES,指定所有HTTP连接都可正常请求 http://dev.umeng.com/social/ios/ios9

<key>NSAppTransportSecuritykey>
<dict>
    <key>NSAllowsArbitraryLoadskey>
    <true/>
dict>

2.  应用跳转(SSO等)

如果你的应用使用了如SSO授权登录或跳转分享功能,在iOS9下就需要增加一个可跳转的白名单,指定对应跳转App的URL Scheme,否则将在第三方平台判断是否跳转时用到的canOpenURL时返回NO,进而只进行webview授权或授权/分享失败。
同样在info.plist增加:

<key>LSApplicationQueriesSchemeskey>
<array>
    
    <string>wechatstring>
    <string>weixinstring>

    
    <string>sinaweibohdstring>
    <string>sinaweibostring>
    <string>sinaweibossostring>
    <string>weibosdkstring>
    <string>weibosdk2.5string>

    
    <string>mqqapistring>
    <string>mqqstring>
    <string>mqqOpensdkSSoLoginstring>
    <string>mqqconnectstring>
    <string>mqqopensdkdatalinestring>
    <string>mqqopensdkgrouptribesharestring>
    <string>mqqopensdkfriendstring>
    <string>mqqopensdkapistring>
    <string>mqqopensdkapiV2string>
    <string>mqqopensdkapiV3string>
    <string>mqzoneopensdkstring>
    <string>wtloginmqqstring>
    <string>wtloginmqq2string>
    <string>mqqwpastring>
    <string>mqzonestring>
    <string>mqzonev2string>
    <string>mqzonesharestring>
    <string>wtloginqzonestring>
    <string>mqzonewxstring>
    <string>mqzoneopensdkapiV2string>
    <string>mqzoneopensdkapi19string>
    <string>mqzoneopensdkapistring>
    <string>mqqbrowserstring>
    <string>mttbrowserstring>

    
    <string>renreniosstring>
    <string>renrenapistring>
    <string>renrenstring>
    <string>renreniphonestring>

    
    <string>laiwangssostring>

    
    <string>yixinstring>
    <string>yixinopenapistring>

    
    <string>instagramstring>

    
    <string>whatsappstring>

    
    <string>linestring>

    
    <string>fbapistring>
    <string>fb-messenger-apistring>
    <string>fbauth2string>
    <string>fbshareextensionstring>
array>

注:以上部分平台官方未给出相应白名单,由技术人员测试各个平台所收集而来,如果有所遗漏,请自行加入并向客服说明,我们会进一步补充名单。

3.  应用瘦身(App Thining)

iOS9 SDK新增了对App瘦身的功能,详情见App Thining。目前各个第三方平台正在进行App thining的支持,所以为了正常使用第三方SDK及分享SDK,需要在Build Setting中将Enable bitcode关闭,或设置编译标识ENABLE_BITCODE=NO。
注:bitcode仅在Xcode7以上显示并默认开启。


你可能感兴趣的:(iOS)