title: PhoneGap Build with OneSignal not working
body: <p>I'm using PhoneGap Build with OneSignal but it is not working. It shows only the first alert message.</p>
  
  <p>Here is the code:
  <a href="https://github.com/claudiosw/ZumitApp/" rel="nofollow">https://github.com/claudiosw/ZumitApp/</a></p>
  
  <p>And you can download the app here:
  <a href="https://build.phonegap.com/apps/2193000/builds" rel="nofollow">https://build.phonegap.com/apps/2193000/builds</a></p>
  
  <p>Also pasting the code here:</p>
  
  <p>File config.xml:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;widget id="com.zumitapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0"&gt;
  
      &lt;name&gt;ZumitApp&lt;/name&gt;
      &lt;description&gt;Tenha Mais Resultados&lt;/description&gt;
      &lt;author email="claudiosw@" href="http://zumitapp.com/App"&gt;Claudio Shigueo Watanabe&lt;/author&gt;
  
      &lt;preference name="phonegap-version" value="cli-6.3.0" /&gt;
      &lt;feature name="http://api.phonegap.com/1.0/device" /&gt;
  
      &lt;preference name="orientation"                value="portrait" /&gt;       &lt;!-- all: default means both landscape and portrait are enabled --&gt;
  
      &lt;gap:plugin name="org.apache.cordova.device" /&gt;
      &lt;gap:plugin name="org.apache.cordova.camera" /&gt;
      &lt;gap:plugin name="org.apache.cordova.media-capture" /&gt;
      &lt;gap:plugin name="org.apache.cordova.file" /&gt;
      &lt;gap:plugin name="org.apache.cordova.file-transfer" /&gt;
      &lt;gap:plugin name="org.apache.cordova.splashscreen" /&gt;
      &lt;gap:plugin name="org.apache.cordova.contacts" /&gt;
      &lt;gap:plugin name="org.apache.cordova.geolocation" /&gt;
      &lt;gap:plugin name="org.apache.cordova.inappbrowser" /&gt;
      &lt;gap:plugin name="org.apache.cordova.dialogs" /&gt;
      &lt;gap:plugin name="org.apache.cordova.vibration" /&gt;
      &lt;gap:plugin name="org.apache.cordova.network-information" /&gt;
      &lt;!--gap:plugin name="com.simplec.plugins.localnotification" /--&gt;
          &lt;!--plugin name="com.onesignal.plugins.onesignal" spec="1.5.0" source="pgb" /--&gt;
          &lt;!--plugin name="com.onesignal.plugins.onesignal" spec="1.9.0" source="pgb" /--&gt;
          &lt;gap:plugin name="onesignal-cordova-plugin-pgb-compat" source="npm" /&gt; 
          &lt;gap:plugin name="cordova-plugin-googleplayservices" source="npm" /&gt; 
          &lt;gap:plugin name="cordova-plugin-android-support-v4" source="npm" /&gt;
  &lt;!--gap:plugin name="onesignal-cordova-plugin" source="npm" /--&gt;
  
  &lt;!-- Recommend the newest cli but requires cli-5.1.1+ and gradle for Android. --&gt;
  &lt;!-- If the below settings are not compatible with your project set the "PGB ANT" version above. --&gt;
  &lt;!--preference name="android-build-tool" value="gradle" /--&gt;
  
  
      &lt;icon src="icon.png" /&gt;
  
      &lt;icon src="res/icons/ios/Icon.png" gap:platform="ios" width="57" height="57" /&gt;
      &lt;icon src="res/icons/ios/Icon@2x.png" gap:platform="ios" width="114" height="114" /&gt;    
      &lt;icon src="res/icons/ios/Icon-72.png" gap:platform="ios" width="72" height="72" /&gt;
      &lt;icon src="res/icons/ios/Icon-72@2x.png" gap:platform="ios" width="144" height="144" /&gt;
  
      &lt;icon src="res/icons/android/drawable-ldpi/Icon.png" gap:platform="android" gap:density="ldpi" /&gt;
      &lt;icon src="res/icons/android/drawable-mdpi/Icon.png" gap:platform="android" gap:density="mdpi" /&gt;
      &lt;icon src="res/icons/android/drawable-hdpi/Icon.png" gap:platform="android" gap:density="hdpi" /&gt;
      &lt;icon src="res/icons/android/drawable-xdpi/Icon.png" gap:platform="android" gap:density="xhdpi" /&gt;
  
      &lt;gap:splash src="ZumitApp_grande.jpg" /&gt;
  
      &lt;gap:splash src="res/screen/android/drawable-ldpi/splash.png"  gap:platform="android" gap:density="ldpi" /&gt;
      &lt;gap:splash src="res/screen/android/drawable-mdpi/splash.png"  gap:platform="android" gap:density="mdpi" /&gt;
      &lt;gap:splash src="res/screen/android/drawable-hdpi/splash.png"  gap:platform="android" gap:density="hdpi" /&gt;
      &lt;gap:splash src="res/screen/android/drawable-xdpi/splash.png" gap:platform="android" gap:density="xhdpi" /&gt;
  
      &lt;gap:splash src="res/screen/ios/Default.png" gap:platform="ios" width="320" height="480" /&gt;
      &lt;gap:splash src="res/screen/ios/Default@2x.png" gap:platform="ios" width="680" height="960" /&gt;
      &lt;gap:splash src="res/screen/ios/Deafult-568h-2x.png" gap:platform="ios" width="640" height="1136" /&gt;
  
      &lt;preference name="stay-in-webview" value="true" /&gt;
      &lt;content src="index.html" /&gt;
      &lt;access origin="*" subdomains="true" /&gt;
      &lt;allow-navigation href="*" /&gt;
  &lt;/widget&gt;
  </code></pre>
  
  <p>File index.html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;ZumitApp&lt;/title&gt;
      &lt;script src="phonegap.js"&gt;&lt;/script&gt;
      &lt;script src="jquery.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          document.addEventListener("deviceready", onDeviceReady, false); 
  function onDeviceReady() {
              // Now safe to use the Codova API
  
    // Enable to debug issues.
    alert("teste0");
    window.plugins.OneSignal.setLogLevel({logLevel: 4, visualLevel: 4});
    alert("teste1");
  
    var notificationOpenedCallback = function(jsonData) {
      console.log('didReceiveRemoteNotificationCallBack: ' + JSON.stringify(jsonData));
    };
  alert("teste2");
    window.plugins.OneSignal.init("22a70849-091e-4eca-8b5b-e7fc5821f95b",
                                   {googleProjectNumber: "428050097085"},
                                   notificationOpenedCallback);
    alert("teste3");
    // Show an alert box if a notification comes in when the user is in your app.
    window.plugins.OneSignal.enableInAppAlertNotification(true);
    //alert("teste4");
       window.location="http://zumitapp.com/App"; 
  //alert("teste5");
  }
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
  
      &lt;header class="bar bar-nav"&gt;
        &lt;h1 class="title"&gt;Boas-vindas ao ZumitApp&lt;/h1&gt;
      &lt;/header&gt;
  
      &lt;h2&gt;Aguarde. Carregando...&lt;/h2&gt;
  
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have tried to debug but it didn't worked out. Maybe it is because my smartphone is old (LG-P705) or the desktop (Windows Vista).</p>
  
  <p>Thanks you very much!</p>