App Transport Security Exceptions IOS9

瘦欲@ 提交于 2020-01-04 05:34:06

问题


I am writing an IOS9 app which uses flickr.

Flicker uses an url format of https://farm{farm-id}.staticflickr.com/

The farm id is a number

In my info.plist I have defined whitelisted domains NSAppTransportSecurity - NSExceptionDomains

How can I define these for the farm id as a wild card?

Currently I just did farm1.staticflickr.com farm2.staticflickr.com......up till 9 but I am unsure how far flickr goes.


回答1:


Add an exception for staticflickr.com and in that exception add a key called NSIncludesSubdomains and set it to true.

<key>NSAppTransportSecurity</key>
    <dict>      
        <key>NSExceptionDomains</key>
        <dict>
            <key>staticflickr.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
            </dict>         
        </dict>
    </dict>


来源:https://stackoverflow.com/questions/32382541/app-transport-security-exceptions-ios9

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!