cordovablackberry-10blackberry-simulatorblackberry-webworks

phonegap 3.2 blackberry10 cross origin access is not allowed


I have cordova/phonegap app that is running fine now on iOS, Android and even wp8. I build the app for blackberry10 and was able to run it in simulator. First thing the app does is try to make some remote XHR calls, but these fails. Here are the errors I am seeing in the remote chrome console:

403 (Forbidden)

https://bloblbolob.kjsdghs.dsf Origin local:// is not allowed by Access-Control-Allow-Origin.

XMLHttpRequest cannot load https://sdkjf.jksdj.kdj Origin local:// is not allowed by Access-Control-Allow-Origin.

I have edited the config.xml and manually replaced the access property with this line:

<access subdomains="true" uri="*" />

However, that did not make any difference.


Solution

  • The * wildcard is not allowed with XmlHttpRequest (XHR) on BlackBerry 10.

    If you intend to use XHR in your BlackBerry 10 app, you must white list the URL as an access element in config.xml.

    More information about accessing external resources: https://developer.blackberry.com/html5/documentation/beta/accessing_external_resources_webworks.html