Did you find a solution?I need to do exactly the same and I don't know how...Hope you can help me!
On Monday, 11 March 2013 17:18:21 UTC+1, Vasilis Lessis wrote: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.
It seems that i can do both separately but not both together.
For the PushNotifications i am using a plugin , which seems to work great.
However when i try to open an external URL from my index.html , the PushNotification doesnt work.
i am trying to use something like this :
<!DOCTYPE html> <html> <head> <title>InAppBrowser.addEventListener Example</title> <script src="cordova-2.5.0.js"></script> <script src="js/PushNotification.js"></script> <script src="js/index.js"></script> <script type="text/javascript" charset="utf-8"> // 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); }); } </script> </head> <body> </body> </html>
and i include the scripts index.js and pushnotifications.js that are needed to enable the push.
But i can only see the URL loading and the push is not enabled.
If i try this , the push is enabled :
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name = "format-detection" content = "telephone=no"/> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width;" /> <title>Push Notification Tester</title> <link href="css/index.css" rel="stylesheet" /> </head> <body> <script src="cordova-2.5.0.js"></script> <script src="js/PushNotification.js"></script> <script src="js/index.js"></script> <script type="text/javascript"> console.log("Test " + app); app.initialize(); </script> </body> </html>
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 ?
Any ideas?