iOS9 http 不能连接的解决办法
2024-10-06 07:10:46
iOS9要求App内访问的网络必须使用HTTPS协议。原有的HTTP请求会报错,适配方法如下。
打开TARGETS-Build Phases, 添加New Run Script Phase,代码如下:
# Add exception for Debug builds
if [ "${CONFIGURATION}" == "Debug" ]
then
# Remove exception existing builds
/usr/libexec/PlistBuddy -c "Delete :NSAppTransportSecurity:NSAllowsArbitraryLoads" "${CONFIGURATION_BUILD_DIR}/${INFOPLIST_PATH}"
exitCode=$? #Supresses failure /usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSAllowsArbitraryLoads bool true" "${CONFIGURATION_BUILD_DIR}/${INFOPLIST_PATH}"
fi
其中"${CONFIGURATION}" == "Debug"的Debug替换为相应编译环境即可
最新文章
- 三、saltstack证书管理
- linux- svn服务器
- Unity3D 判断鼠标是否按在UGUI上
- 检测是否安装了 .NET Framework 3.5
- 测试php页面执行代码时间
- 【USACO 2.1.5】海明码
- js到记时代码
- [SignalR]在非Hub继承类中使用脚本方法
- .net core 单元测试小记
- ●BZOJ 2329 [HNOI2011]括号修复.cpp
- Java基础 -- String,StringBuilder,StringBuffer三者的区别
- OpenResty安装使用教程(CentOS 6)
- github 推送代码
- UIImage常用封装
- PHP入门(一)
- ElasticSearch(十):springboot集成ElasticSearch集群完成数据的增,删,改
- 在rhel6上安装Python 2.7和Python 3.3
- leetcode 84. 柱状图中最大的矩形 JAVA
- Zip文件格式
- maven <;repositories>;标签,<;pluginRepositories>;标签
热门文章
- POJ 2752 Seek the Name, Seek the Fame(KMP中next的理解)题解
- miRNA几大常用的数据库
- sublime+LatexTools引用参考文献
- Python day5_tuple元祖的常见方法1_笔记
- F4+2 团队项目软件设计方案
- Codeforces 899E - Segments Removal
- Codeforces 614E - Necklace
- Ubuntu 16.04下docker ce的安装
- dd 命令常用功能收集(ing...)
- Hive之 Python写UDF