The resource could not be loaded because the App Transport Security policy requires the use of a secure connection

前端 未结 21 1958
醉酒成梦
醉酒成梦 2020-11-22 11:37

I am facing the Problem when I have updated my Xcode to 7.0 or iOS 9.0. Somehow it started giving me the Titled error

\"The resource could not be load

21条回答
  •  孤独总比滥情好
    2020-11-22 12:35

    Be aware, using NSAllowsArbitraryLoads = true in the project's info.plist allows all connection to any server to be insecure. If you want to make sure only a specific domain is accessible through an insecure connection, try this:

    Or, as source code:

    NSAppTransportSecurity
    
        NSExceptionDomains
        
            domain.com
            
                NSExceptionAllowsInsecureHTTPLoads
                
                NSIncludesSubdomains
                
            
        
    
    

    Clean & Build project after editing.

提交回复
热议问题