IOS9-xcode7 Common Errors https troubleshooting

Source: Internet
Author: User

IOS9-xcode7 Common Errors https troubleshooting
Errors

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

Tom is not panic. This is the upgraded https problem of ios9. It is easy to solve. Close him. We still use http

Solution

1: add the NSAppTransportSecurity type Dictionary to Info. plist.
2: Add a Boolean of the NSAllowsArbitraryLoads type under NSAppTransportSecurity. The value is set to YES.
3: note that there is also an Info. plist in the unit test. modifying that file does not work!

Others

If you want some domain names to support https, you can also configure it as follows:
Supplemented the configuration method
If HTTPS is not supported, add exceptions first.

The method for adding exceptions is also simple:
Left click Info. plist and select open with source code
Then add a configuration similar to the following:

    
  
   NSAppTransportSecurity
      
          
   
    NSExceptionDomains
           
               
    
     qq.com
                
                    
     
      NSIncludesSubdomains
                     
                 
     
                
    
     sina.com.cn
                
                    
     
      NSIncludesSubdomains
                     
                 
     
               
      
  

According to the domain name modification you need, NSIncludeSubdomains includes subdomains.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.