01-19-2013 02:07 AM
I am trying to make an Ajax call to a local netowork IP over Wi-Fi on a different port than 80.. When executed on an actual device, I always get "Access to XYZ is not allowed" where XYZ is the URL of my attempt.
The app is intended to be a management app for a hardware box from a certain manufacturer that the user has on their home network. The online 'cloud' service API tells the app what the local IP of the box is, then the app attempts to make API calls against the unit on that IP.
Example call: http://192.168.2.15:1234/api_call_here
In config.xml I have tried many things, including:
<access uri="*" />
<access uri="http://192.168.2.15:1234" /> (which wouldn't work for me in production, since I'll never know the local IP before hand)
...but nothing seems to allow the connection to another local network IP. WebInspector shows that the connection was blocked by NativeCode:1.
Can it be done? Or this this somehow blocked by the framework?
Solved! Go to Solution.
01-20-2013 12:06 AM
Global whitelisting for XHR is not currently supported.
For your scenario to work, you will need to disable web security.
<feature id="blackberry.app" > <param name="websecurity" value="disable" /> </feature>