在plist文件上实现2个ATS规范

时间:2015-09-19 07:22:59

标签: ios objective-c xcode ios9

我的应用程序包括Chartboost和Facebook的SDK。遵循iOS 9 ATS要求,我试图制作这两个供应商网站上描述的plist文件。

我想将这两者合二为一,但我不确定如何。 有人可以帮我吗?

Chartboost说明:

<key>NSAppTransportSecurity</key>
        <dict>
            <key>NSAllowsArbitraryLoads</key>
            <true />
            <key>NSExceptionDomains</key>
            <dict>
                <key>chartboost.com</key>
                <dict>
                    <key>NSIncludesSubdomains</key>
                    <true />
                </dict>
            </dict>
        </dict>

Facebook指示:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>facebook.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true />
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false />
        </dict>
        <key>fbcdn.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true />
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false />
        </dict>
        <key>akamaihd.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true />
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false />
        </dict>
    </dict>
</dict>

1 个答案:

答案 0 :(得分:1)

您的plist文件中只有一个NSAppTransportSecurityDictionary 您需要将所有异常组合到一个NSExceptionDomains -

下的NSAppTransportSecurity个实例中
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSExceptionDomains</key>
    <dict>
        <key>chartboost.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
        </dict>
        <key>facebook.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>fbcdn.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>akamaihd.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>