On Wed, Feb 19, 2014 at 10:53 AM, Miguel Lemos <miguel21op@gmail.com> wrote:
2 > I insist: the documentation / examples you give about the correct URLs to use is incoherent and not enough clear (sorry, this is my opinion);Hello,1 > The Openshift explanation:
https://www.openshift.com/blogs/mobile-push-simplified-with-the-aerogear-push-server-on-openshift
ah, ok - yeah, that's an outdated blog of our first release (0.8.0); We will see if we can update that, as APIs have changed4 > As I told you in my previous post the device registers correctly, meaning there is a token, etc of it on the server. See picture attached;3 > The Android version I use on the testing device: 4.2.1 and Cordova 3.3
Great - the device is registered, that's good news7 > The Javascript code inside my app:6 > Please see attached the libraries I'm using on my Android app;
5> Yes there is an account, etc on Google service, where the Google cloud Messaging for Android is set to on (if you want I can send to you the credentials; later on I'll generate new ones);
document.addEventListener('deviceready', function(){
var pushConfig = { // credentials not real; I thing this goes live...
senderID: "278695548260",
pushServerURL: "https://aerogear-metalpush.rhcloud.com",
variantID: "821460c5-ez9f-41d8-903a-61e7bd132038",
variantSecret: "43b0e5e4-f217-4f29-b15b-85f8f5748ee6"
}
try {
push.register(successHandler, errorHandler, {"badge": "true", "sound": "true",
"alert": "true", "ecb": "onNotification", pushConfig: pushConfig});
} catch (err) {
txt = "Erro encontrado.\n\n";
txt += "Descrição do erro: " + err.message + "\n\n";
alert(txt);
}
function successHandler(result) {
var respush = document.getElementById("pushst");
respush.innerHTML = "Notificações: registo efetuado";
}
function errorHandler(error) {
var respush = document.getElementById("pushst");
respush.innerHTML = "Notificções: registo falhado";
}
function onNotification(e) {
alert(e.alert);
}Oh, just a thought - the scope of the 'onNotification'I always used it as a globla function, like:
}, false);I think I'm answering to all your questions. Any help appreciated.
Feel free to ask whatever you need to enlighten this situation.Miguel--
Matthias Wessendorf
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev