cordova-plugin-transport-security icon indicating copy to clipboard operation
cordova-plugin-transport-security copied to clipboard

Can't this be accomplished by just using the config.xml?

Open johnborges opened this issue 8 years ago • 3 comments

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"/>

docs

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>

johnborges avatar Oct 14 '16 20:10 johnborges

This worked for me for the pure use case as described above.

pmmenneg avatar Oct 25 '16 21:10 pmmenneg

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?

ankon avatar Nov 07 '16 16:11 ankon

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

Stephane84 avatar Mar 18 '21 15:03 Stephane84