微博API iOS9的适配问题
2016-03-24 19:50
246 查看
iOS9的适配问题
由于iOS9的发布影响了微博SDK与应用的集成方式,为了确保好的应用体验,我们需要采取如下措施:
1.对传输安全的支持
在新一代的iOS系统中,默认需要为每次网络传输建立SSL。解决这个问题有两种方法:
-
A.建立白名单并添加到你的app的plsit中
<key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>sina.cn</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>weibo.cn</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>weibo.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>sinaimg.cn</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>sinajs.cn</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>sina.com.cn</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> </dict> </dict>
如果没有添加可能会遇到"An SSL error has occurred and a secure connection to the server cannot be made."这样的问题。
-
B.强制将NSAllowsArbitraryLoads属性设置为YES,并添加到你应用的plist中,这样每个网页都是不安全传输,所以不建议这样做!
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> </true> </dict>
相关文章推荐
- Linux Generating SSH Keys
- perl脚本实现限制ssh最大登录次数(支持白名单)
- rsync ssh 数据同步分析
- 搭建SSH时的思考和遇到的几个问题的解决方法
- SSH 使用原理 与解释
- SSH整合中 hibernate托管给Spring得到SessionFactory
- Linux VPS利用SSH重置ROOT密码的方法
- ssh,scp自动登陆的实现方法
- linux下使用ssh远程执行命令批量导出数据库到本地
- shell脚本实现ssh自动登录功能分享
- linux下ssh安装与scp命令使用详解
- ssh项目环境搭建步骤(web项目)
- 脚本实现SSH登录邮件报警
- Linux SSH 安全策略 限制 IP 登录方法
- 解决SSH连接超时的2个配置方法
- 用shell脚本防ssh和vsftpd暴力破解的详解讲解
- 内网ssh/mysql登录缓慢的解决方法
- Java实现SSH模式加密
- Linux sshd_config配置手册中文版