cordova-plugin-transport-security
cordova-plugin-transport-security copied to clipboard
Can't this be accomplished by just using the config.xml?
Firstly, I just wanted to say that your plugin helped me accomplish dynamically editing my project's *-Info.plist
. I'm using it to add dictionary entries that wouldn't normally be easy to get too. After getting a better understanding on how Cordova handles ATS, I don't think it really makes sense to use this plugin for ATS specific purposes.
The config.xml
gives a couple of options for controlling the Whitelist and working with ATS using the <access origin=""/>
tag. Going off of your example in the README.MD, the same can be done without this plugin:
<access origin="*://*.github.com"/>
Produces the following in *-Info.plist
after running cordova build ios
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>www.github.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
This worked for me for the pure use case as described above.
According to http://cordova.apache.org/docs/en/latest/guide/appdev/whitelist/index.html#ios-whitelisting and https://issues.apache.org/jira/browse/CB-11440 (default is NSAllowArbitraryLoads=true) this plugin seems to be indeed unneeded?
If it help someone to read this : Here is a plugin that works well : https://github.com/knight9999/cordovax-edit-ats I juste change the type of hook from after_platform_add to before_compile