angularjs - GET and POST calls fail to load resource -


in ionic application, every $http post or get call gets blocked:

failed load resource: net::err_name_not_resolved

it works fine in ipv4 shows error when select ipv6 in apns settings in our phone networks. how should continue?

config.xml file

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>     <widget id="com.jio.smart.vehicle" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">       <name>name</name>       <description>&#xd;&#xd;             ionic framework , cordova project.&#xd;&#xd;         </description>       <author email="hi@ionicframework" href="http://ionicframework.com/">&#xd;&#xd;           ionic framework team&#xd;&#xd;         </author>       <content src="index.html"/>       <access origin="*" subdomains="true"/>       <access origin="tel:*" launch-external="yes"/>       <access origin="cdvfile://*"/>       <allow-navigation href="*" />       <preference name="webviewbounce" value="false"/>       <preference name="uiwebviewbounce" value="false"/>       <preference name="disallowoverscroll" value="true"/>       <preference name="android-minsdkversion" value="16"/>       <preference name="loadurltimeoutvalue" value="700000" />       <preference name="fadesplashscreen" value="false"/>       <preference name="androidpersistentfilelocation" value="compatibility"/>       <preference name="backupwebstorage" value="none"/>       <preference name="splashscreen" value="screen"/>       <preference name="android-windowsoftinputmode" value="adjustpan"/>       <preference name="autohidesplashscreen" value="false" />       <preference name="showsplashscreenspinner" value="true"/>       <preference name="statusbaroverlayswebview" value="false"/>       <preference name="android-targetsdkversion" value="20"/>       <hook type="before_run" src="hooks/appbeforebuild.js" />       <feature name="statusbar">         <param name="ios-package" value="cdvstatusbar" onload="true"/>       </feature>       <platform name="android">         <icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/>       </platform>       <icon src="resources\android\icon\drawable-xhdpi-icon.png"/>     </widget> 

  • reason why , post calls failed ?

    you had missed cordova whitelist plugin.it required make or post request. installation command

    cordova plugin add cordova-plugin-whitelist

    navigation whitelist

controls urls webview can navigated to. applies top-level navigations only.

quirks: on android applies iframes non-http(s) schemes.

by default, navigations file:// urls, allowed. allow others urls, must add tags config.xml:

 <!-- allow links example.com --> <allow-navigation href="http://example.com/*" />  <!-- wildcards allowed protocol, prefix      host, or suffix path --> <allow-navigation href="*://*.example.com/*" />  <!-- wildcard can used whitelist entire network,      on http , https.      *not recommended* --> <allow-navigation href="*" />  <!-- above equivalent these 3 declarations --> <allow-navigation href="http://*/*" /> <allow-navigation href="https://*/*" /> <allow-navigation href="data:*" /> 

for better understanding please visit official documentation


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -