2016-12-30 16 views
0

phonegap buildを使用してモバイルアプリを構築しています。私はiOS、Android、Windows用のビルドアプリを持っており、TestObjectでテストしています。私のアプリでやっていることは、ページの読み込み自体にhttp://google.comにリダイレクトしています。PhoneGapビルドアプリがiOSで動作しない

index.htmlを

<!DOCTYPE html> 

<html> 
    <head> 
     <script type="text/javascript" charset="utf-8" src="cordova.js"></script> 
     <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script> 
     <script type="text/javascript" charset="utf-8"> 
      function onLoad() { 
        document.addEventListener("deviceready", onDeviceReady, true); 
      } 

      function onDeviceReady() { 
       window.location.href = "http://google.com"; 
      } 
     </script> 
    </head> 
    <body onload="onLoad();"> 
    </body> 
</html> 

config.xmlの

<?xml version="1.0" encoding="UTF-8" ?> 
    <widget xmlns = "http://www.w3.org/ns/widgets" 
     xmlns:gap = "http://phonegap.com/ns/1.0" 
     id   = "com.newApp.mobileApp" 
     versionCode = "1" 
     version  = "1.0.0" > 

    <!-- versionCode is Android only --> 
    <!-- version is in major.minor.patch format --> 
    <name>My New App</name> 

    <description> 
     An example for phonegap build app which wont show up in the playstore. 
    </description> 

    <author href="https://YourWebsite.com" email="[email protected]"> 
     Name Of The Author 
    </author> 

    <plugin name="cordova-plugin-whitelist" source="npm"/> 
</widget> 

アンドロイド(APKファイル)でテストが、それは、google.comにリダイレクトされます。しかし、iOSデバイス(ipaファイル)でテストすると、空白ページのみが表示されています。

なぜiOSで動作しないのですか?

誰でもこの問題を解決する手助けはできますか?前もって感謝します。

+0

iosデバイスが制限しないようにオプションを設定しましたか? ..できる場合はあなたのconfig.xmlをポストしてください –

+0

あなたは間違ったタグを持っています - 'PHP' – mishanon

+0

@ federicoscamuzzi。最新の質問をご覧ください。 – Jenz

答えて

0
<access origin="*" launch-external="yes" /> 
    <allow-intent href="http://*/*" /> 
    <allow-intent href="https://*/*" /> 
    <access origin="http://127.0.0.1*"/> 
    <allow-navigation href="*"/> 
    <allow-intent href="*"/> 

ホワイトリストに関する安全側になるように、私は上記に加えて、私のアプリ

でこれらのインテントを使用して、私は、Android

<gap:plugin name="cordova-plugin-whitelist" version="1.1.0" source="npm" /> 

およびIOS

ため、このプラグインを追加
<plugin name="cordova-plugin-whitelist" spec="https://github.com/apache/cordova-plugin-whitelist.git" /> 
関連する問題