Cordova Whitelist Cross-domain request issue

Hi Folks,

As I mentioned somewhere in my previous posts,  installing whitelist plugin for cordova(5.0+) platforms in now compulsary to get server call working. In config.xml file add below line-

<access origin=”*” subdomains=”true” />

Above will ensure ajax requests happen properly on Android, IOS and Windows phones. But Blackberry10, it needs one more fix. Without adding below line, I was able to make a server call but only OPTIONS request was being received. As soon as the response is received, blackberry browser is blocking the server calls treating it as Cross-Domain request.

<preference name=”websecurity” value=”disable” />

You need to disable websecurity by adding above line to your config.xml file to get it working for Blackerry10. I’ve seen few posts mentioning this should not be used in production but as of now, I could not find any alternative. I’ll update this post shortly if I find anything better.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s