Do phonegap applications require any CORS changes (like setting Access-Control-Allow-Origin:*) to work? I have a restful API hosted on Heroku and was wondering whether I need to set this header in order for my phonegap application to call the service?
I was thinking that because the phonegap application isn't really hosted on a domain, then CORS isn't required and I won't get any cross domain issues?
It would be great if someone could explain to me why this is or isn't the case.
Apache Cordova (formerly PhoneGap) is a mobile application development framework created by Nitobi. Adobe Systems purchased Nitobi in 2011, rebranded it as PhoneGap, and later released an open-source version of the software called Apache Cordova.
Hybrid apps are developed using web technologies: HTML5, CSS and JavaScript, then put inside a native container such Adobe PhoneGap. These native containers run the web application code and package it into an app.
PhoneGap was originally developed by a company called Nitobi Software, which was acquired by Adobe in 2011. The technology was donated as an open source project to the Apache Software Foundation with the name Apache Cordova.
Effective immediately, App Center will no longer offer the option to create Apache Cordova apps through the portal, CLI or API. Starting April 1, 2022, the App Center service will no longer accept calls from the Cordova SDK.
PhoneGap you can just XHR directly to remote servers and it should "just work". Cross-domain policy does not apply to PhoneGap (for a variety of reasons, basically because your app is essentially running off the file:// URI on-device).
Please be aware that you will have to set up a whitelist for your apps to access these external domains. Please check this link:
http://docs.phonegap.com/en/1.8.0rc1/guide_whitelist_index.md.html#Domain%20Whitelist%20Guide
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With