Ajax Not working in IOS 9.0 Cordova
HelloCordova[8103:64801] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file.

Solution 1:

https://gist.github.com/mlynch/284699d676fe9ed0abfa

<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
  
    PASTE HERE
  </dict>
</plist>
-->
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>

 

Phonegap screen shot1

Solution 2:

https://www.npmjs.com/package/cordova-plugin-transport-security

9844542127-mac1:php-mamp-wamp jay$ mkdir app5
9844542127-mac1:php-mamp-wamp jay$ cd mkdir
-bash: cd: mkdir: No such file or directory
9844542127-mac1:php-mamp-wamp jay$ cd app5
9844542127-mac1:app5 jay$ cordova create testhrt --name
Creating a new cordova project with name "HelloCordova" and id "io.cordova.hellocordova" at location "/Users/jay/9844542127/im-mac-desktop/php-mamp-wamp/app5/testhrt"
9844542127-mac1:app5 jay$ cordova platform add ios
Current working directory is not a Cordova-based project.
9844542127-mac1:app5 jay$ cd testhrt/
9844542127-mac1:testhrt jay$ cordova platform add ios
Creating ios project...
9844542127-mac1:testhrt jay$ cordova plugin add cordova-plugin-transport-security
Fetching plugin "cordova-plugin-transport-security" via plugin registry
Error: 404 Not Found: cordova-plugin-transport-security
    at RegClient.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:304:14)
    at Request._callback (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:246:65)
    at Request.self.callback (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/request.js:236:22)
    at Request.emit (events.js:110:17)
    at Request.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/request.js:1142:14)
    at Request.emit (events.js:129:20)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/request.js:1096:12)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)
9844542127-mac1:testhrt jay$ cordova plugin add https://github.com/leecrossley/cordova-plugin-transport-security.git
Fetching plugin "https://github.com/leecrossley/cordova-plugin-transport-security.git" via git clone
Installing "cordova-plugin-transport-security" for ios
9844542127-mac1:testhrt jay$

 

phone gap screen shot2

 

 

 

Share on Facebook