Same Origin Issue with Cordova and Phonegap

by
Whitelist remote domains to post and receive data from remote sources. Please use new Android Studio instead. More info here..

Allow your phonegap or cordova application to receive data from outside of your app(external url and post information to and from outside sources). You can set this in config.xml for apache cordova or phonegap.xml if your project is still on phonegap 1.4.1

Enter a domain name or Asterisk (*) in origin attribute of access tag in config.xml. Config.xom can be found in your phonegap project under res/xml/config.xml for phonegap 1.4.1(maybe also prior versions). You can also create a phonegap.xml file inside xml folder in the root of your eclipse project. Only create it if it doesn't already exist. There will be plugins.xml file already in xml folder.

Here is the default text to create phonegap.xml file for phonegap 1.4.1

You can simply use a Asterisk (*) to allow everything. Here is an example:

For Apache Cordova when making Android App using phonegap in eclipse

For IOS xcode project set external hosts in cordova.plist or phonegap.plist

Simply mouse over ExternalHosts row and press plus sign and item 0 row will drop down then click next to string column to enter your website domain name.
Z Data Tech https://www.zdatatech.com/logo/zdatatech-logo.png Last modified: January 30, 2023
Suggested
Advertisement