iOS9 的那些坑

1.在Info.plist中添加NSAppTransportSecurity类型Dictionary。
2.在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES


iOS9 的那些坑_第1张图片
Paste_Image.png

用source code打开如下:

NSAppTransportSecurity

    
    NSAllowsArbitraryLoads
    

针对个别网站配置

![D5PO]DYP53WT9ZRG%@$VY.jpg](http://upload-images.jianshu.io/upload_images/228486-2153743117f36c38.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

1.子域名同样适用
NSIncludesSubdomains Boolean类型 YES
2.禁用ForwardSecrecy
NSExceptionRequiresForwardSecrecy Boolean类型 NO
3.允许签名过期 或者不匹配情况
NSTemporaryExceptionAllowsInsecureHTTPLoads Boolean类型 YES

用source code打开如下:

NSAppTransportSecurity

NSExceptionDomains

baidu.com

NSExceptionRequiresForwardSecrecy

NSIncludesSubdomains

NSTemporaryExceptionAllowsInsecureHTTPLoads

NSTemporaryExceptionMinimumTLSVersion
TLSv1.1



iOS 9 分享适配

URL Scheme 用于应用程序的分享或者跳转到其他平台的授权,分享或者授权后再跳回来
在iOS 8 没有做限制,但是在iOS 9 需要将在外部调用的URL Scheme列为白名单才可以跳转
没做适配的情况下 会报错:
-canOpenURL: failed for URL: "mqq://" - error: "This app is not allowed to query for scheme mqq"
解决办法:在info.plist设置LSApplicationQueriesSchemes(数组),在里面添加用到的URL Scheme

iOS9 的那些坑_第2张图片
Paste_Image.png

用source code打开如下:

LSApplicationQueriesSchemes

    
    wechat
    weixin
    
    mqqapi
    mqq
    mqqOpensdkSSoLogin
    mqqconnect
    mqqopensdkdataline
    mqqopensdkgrouptribeshare
    mqqopensdkfriend
    mqqopensdkapi
    mqqopensdkapiV2
    mqqopensdkapiV3
    mqzoneopensdk
    wtloginmqq
    wtloginmqq2
    mqqwpa
    mqzone
    mqzonev2
    mqzoneshare
    wtloginqzone
    mqzonewx
    mqzoneopensdkapiV2
    mqzoneopensdkapi19
    mqzoneopensdkapi
    mqzoneopensdk

============================================
注:

 
 qq.com
  
 NSIncludesSubdomains
  
 NSThirdPartyExceptionAllowsInsecureHTTPLoads 
 
 NSThirdPartyExceptionRequiresForwardSecrecy 
 
 
 

============================================

另外 还要注意iOS 9 以后可能有些lable的内容是显示不全的!

你可能感兴趣的:(iOS9 的那些坑)