Ok so I managed to deploy my cordova app onto genymotion. Actually that wasnt too difficult.
But, alas, it still does not connect to the UPS.
I have updated the pushServerURL value to use my hosts ip.
My index.html looks like this - I notice it is referencing cordova.js, but this file is missing in the eclipse project. I assume eclipse automagically adds it when the project is built.
Ive removed the send, variant and variant secret - to protect the identity of the innocent.
<!DOCTYPE HTML>
<html>
<head>
<title>Demo</title>
</head>
<body>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8" src="jquery_1.5.2.min.js"></script>
<script type="text/javascript">
var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
var pushConfig = {
android: {
senderID: "",
variantID: "",
variantSecret: ""
}
};
push.register(app.onNotification, successHandler, errorHandler, pushConfig);
function successHandler() {
console.log('success')
}
function errorHandler(message) {
console.log('error ' + message);
}
},
onNotification: function(event) {
alert(event.alert);
},
// Update DOM on a Received Event
receivedEvent: function(id) {
var parentElement = document.getElementById(id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');
console.log('Received Event: ' + id);
}
};
app.initialize();
document.addEventListener('deviceready', onDeviceReady, true);
</script>
<div id="home">
<div id="app-status-div">
<ul id="app-status-ul">
<li>AeroGear PushPlugin Unified Push Demo</li>
</ul>
</div>
</div>
</body>
</html>