Fix iOS 9 App Transport Security Issues In Apache Cordova

简介: The release of iOS 9 has caused a mess of problems in the Apache Cordova, Ionic Framework, and PhoneGap communities.

The release of iOS 9 has caused a mess of problems in the Apache Cordova, Ionic Framework, and PhoneGap communities.  Problems spanning from styling issues, to permission issues, and even stricter security requirements that Apache Cordova wasn’t ready to handle.

Here I’m going to discuss App Transport Security (ATS) an issue that is rapidly appearing amongst app developers.

If your Apache Cordova application uses the InAppBrowser plugin to access external resources such as websites, you might have experienced the following error:

Although not fun to see, it is actually a good thing because iOS wants connections to be secure.  This security measure can actually be overwritten to allow your application to perform like it did in earlier versions of iOS.  You need to add the following to your Xcode info.plist file:

Building and running your application again should present better results.  ATS is not limited to only the InAppBrowser plugin, even though that is the most reported cause that I see.

A Real Life Example

Let’s say you are using the ng-cordova-oauth library that I wrote.  Out of the box it will work fine with Android and iOS versions earlier than 9.0.  However in iOS 9 you’ll get ATS errors.  When you try to initiate the oauth login flow you’ll be left with a blank screen wondering what went wrong.

If you don’t want to disable App Transport Security for all domains, you can make domain exceptions as described in the official documentation released by Apple.  This will keep application security as strong as possible.

Conclusion

As much of a pain App Transport Security (ATS) seems in iOS 9, it is actually a positive thing for your users.  With a few modifications you can make exceptions to allow communication between the application and insecure external resources.

目录
相关文章
|
3月前
|
API 数据安全/隐私保护 iOS开发
利用uni-app 开发的iOS app 发布到App Store全流程
利用uni-app 开发的iOS app 发布到App Store全流程
189 3
|
3月前
|
移动开发 安全 数据安全/隐私保护
iOS移动应用安全加固:保护您的App免受恶意攻击的重要步骤
iOS移动应用安全加固:保护您的App免受恶意攻击的重要步骤
54 1
|
6天前
|
编解码 iOS开发
IOS上架APP Store时预览图尺寸
IOS上架APP Store时预览图尺寸
18 3
|
4天前
|
iOS开发
App备案与iOS云管理式证书 ,公钥及证书SHA-1指纹的获取方法
App备案与iOS云管理式证书 ,公钥及证书SHA-1指纹的获取方法
13 0
App备案与iOS云管理式证书 ,公钥及证书SHA-1指纹的获取方法
|
6天前
|
开发工具 iOS开发
解决Flutter运行报错Could not run build/ios/iphoneos/Runner.app
解决Flutter运行报错Could not run build/ios/iphoneos/Runner.app
27 2
|
6天前
|
iOS开发
解决IOS上架App Store后显示语言为英文的问题
解决IOS上架App Store后显示语言为英文的问题
13 0
|
3月前
如何解决iOS16系统app首次启动总是弹出允许粘贴提示框问题
如何解决iOS16系统app首次启动总是弹出允许粘贴提示框问题
48 0
如何解决iOS16系统app首次启动总是弹出允许粘贴提示框问题
|
3月前
|
大数据 测试技术 数据库
ios app性能分析
ios app性能分析
32 2
|
3月前
|
定位技术 开发工具 iOS开发
ios9定位服务的app进入后台三分钟收不到经纬度,应用被挂起问题及解决方案
ios9定位服务的app进入后台三分钟收不到经纬度,应用被挂起问题及解决方案
36 0
|
3月前
|
iOS开发 网络架构 UED
ios app的分类与本质,感想
ios app的分类与本质,感想
32 0

推荐镜像

更多