You can install whitelist plugin using
phonegap plugin add https://github.com/apache/cordova-plugin-whitelist.git
command from CLI.
After that add <access>
tags in config.xml
P.S. It's not good idea to add <access origin="*"/>
, so add <access>
tags only for the domains you will fetch data.
Some expamples of <access>
tags.
<!-- Allow images, xhrs, etc. to google.com -->
<access origin="http://google.com" />
<access origin="https://google.com" />
<!-- Access to the subdomain maps.google.com -->
<access origin="http://maps.google.com" />
<!-- Access to all the subdomains on google.com -->
<access origin="http://*.google.com" />
You can read more at Plugin's documentation https://github.com/apache/cordova-plugin-whitelist