Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to load an external URL on PhoneGap/Cordova and have PushNotifications enabled?
    primarykey
    data
    text
    <p>What i am trying to do is make an iOS PhoneGap/Cordova application that , the only thing it does is load an external URL and have PushNotifications Enabled.</p> <p>It seems that i can do both separately but not both together.</p> <p>For the PushNotifications i am using a plugin , which seems to work great.</p> <p>However when i try to open an external URL from my index.html , the PushNotification doesnt work.</p> <p>I am using this tutorial to enable Push <a href="http://devgirl.org/2012/10/19/tutorial-apple-push-notifications-with-phonegap-part-1/">iOS PhoneGap/Cordova Push</a>.</p> <p>And after i download the sample code i am trying to use something like this :</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;InAppBrowser.addEventListener Example&lt;/title&gt; &lt;script src="cordova-2.5.0.js"&gt;&lt;/script&gt; &lt;script src="js/PushNotification.js"&gt;&lt;/script&gt; &lt;script src="js/index.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8"&gt; // Wait for Cordova to load // document.addEventListener("deviceready", onDeviceReady, false); // Cordova is ready // function onDeviceReady() { var ref = window.open('http://apache.org', '_blank', 'location=yes'); ref.addEventListener('loadstart', function() { alert('start: ' + event.url); }); ref.addEventListener('loadstop', function() { alert('stop: ' + event.url); }); ref.addEventListener('exit', function() { alert(event.type); }); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and i include the scripts index.js and pushnotifications.js that are needed to enable the push.</p> <p>But i can only see the URL loading and the push is not enabled.</p> <p>If i try this , the push is enabled :</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;meta name = "format-detection" content = "telephone=no"/&gt; &lt;meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width;" /&gt; &lt;title&gt;Push Notification Tester&lt;/title&gt; &lt;link href="css/index.css" rel="stylesheet" /&gt; &lt;/head&gt; &lt;body&gt; &lt;script src="cordova-2.5.0.js"&gt;&lt;/script&gt; &lt;script src="js/PushNotification.js"&gt;&lt;/script&gt; &lt;script src="js/index.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; console.log("Test " + app); app.initialize(); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>But of course in this example , i am not using an external Url as i would like. So how would i add on this code the external Url function to have both external url and push ?</p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload