2016-11-17 48 views
1

在我的應用離子,每$http POSTGET呼叫被阻止:GET和POST調用失敗加載資源

無法加載資源:淨:: ERR_NAME_NOT_RESOLVED

它工作正常,在IPv4中但在我們的電話網絡的APNS設置中選擇Ipv6時會顯示錯誤。我應該如何繼續?

Config.xml文件

<?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; 
      An Ionic Framework and Cordova project.&#xD;&#xD; 
     </description> 
     <author email="[email protected]" 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> 
+0

請出示你的代碼。 –

+0

@HassanALi你想看哪個文件? –

+0

config.xml和你在哪裏訪問互聯網。謝謝 –

回答

0
  • 之所以GET和POST調用失敗了嗎?

    您錯過了科爾多瓦白名單Plugin.It需要做GET或POST請求。 安裝命令

    科爾多瓦插件添加科爾多瓦 - 插件白名單

    導航白名單

控制哪些網址的web視圖本身可以瀏覽到。僅適用於 頂級導航。

怪癖:在Android上它也適用於非http(s)方案的iframe。

默認情況下,僅允許導航到file:// URLs。要允許別人 的網址,您必須添加標籤到您的config.xml:

<!-- Allow links to example.com --> 
<allow-navigation href="http://example.com/*" /> 

<!-- Wildcards are allowed for the protocol, as a prefix 
    to the host, or as a suffix to the path --> 
<allow-navigation href="*://*.example.com/*" /> 

<!-- A wildcard can be used to whitelist the entire network, 
    over HTTP and HTTPS. 
    *NOT RECOMMENDED* --> 
<allow-navigation href="*" /> 

<!-- The above is equivalent to these three declarations --> 
<allow-navigation href="http://*/*" /> 
<allow-navigation href="https://*/*" /> 
<allow-navigation href="data:*" /> 

爲了更好的理解,請訪問Official文檔

+0

我已經嘗試過,但錯誤沒有解決...其他任何事情去做 ?? –

+0

沒有它唯一的問題。因爲我沒有在你的config.xml中看到你的cordova白名單插件。如果您嘗試過,請更新您的問題。謝謝 –

+0

我更新了我的配置文件,但仍然沒有解決問題。 –

相關問題