<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 19, 2014 at 11:08 AM, Matthias Wessendorf <span dir="ltr"><<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">
<div class="">On Wed, Feb 19, 2014 at 10:53 AM, Miguel Lemos <span dir="ltr"><<a href="mailto:miguel21op@gmail.com" target="_blank">miguel21op@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hello,<br>
<br></div>1 > The Openshift explanation:<br><br><a href="https://www.openshift.com/blogs/mobile-push-simplified-with-the-aerogear-push-server-on-openshift" target="_blank">https://www.openshift.com/blogs/mobile-push-simplified-with-the-aerogear-push-server-on-openshift</a><br>
<br></div>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);<br></div></div></div></div></div></div></blockquote><div><br>
</div></div><div>a<span style="font-family:arial,sans-serif;font-size:13px">h, 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 changed </span></div><div class="">
<div><br></div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><br></div>
3 > The Android version I use on the testing device: 4.2.1 and Cordova 3.3<br>
<br></div>4 > 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;<br></div></div></div></div></blockquote><div><br></div><div><br>
</div></div><div><span style="font-family:arial,sans-serif;font-size:13px">Great - the device is registered, that's good news</span></div><div class=""><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div><div><div></div><br>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);<br>
<br></div>6 > Please see attached the libraries I'm using on my Android app;<br><br></div>7 > The Javascript code inside my app:<br><br>document.addEventListener('deviceready', function(){<br> <br> var pushConfig = { // credentials not real; I thing this goes live...<br>
senderID: "278695548260",<br> pushServerURL: "<a href="https://aerogear-metalpush.rhcloud.com" target="_blank">https://aerogear-metalpush.rhcloud.com</a>", <br> variantID: "821460c5-ez9f-41d8-903a-61e7bd132038",<br>
variantSecret: "43b0e5e4-f217-4f29-b15b-85f8f5748ee6"<br> }<br> <br> try {<br> push.register(successHandler, errorHandler, {"badge": "true", "sound": "true",<br>
"alert": "true", "ecb": "onNotification", pushConfig: pushConfig});<br> <br> } catch (err) {<br> txt = "Erro encontrado.\n\n";<br> txt += "Descrição do erro: " + err.message + "\n\n";<br>
alert(txt);<br> }<br><br> function successHandler(result) {<br> var respush = document.getElementById("pushst");<br> respush.innerHTML = "Notificações: registo efetuado";<br> }<br>
<br> function errorHandler(error) {<br> var respush = document.getElementById("pushst");<br> respush.innerHTML = "Notificções: registo falhado";<br> }<br> <br> function onNotification(e) {<br>
alert(e.alert);<br> }<br></div></blockquote><div><br></div><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px">Oh, just a thought - the scope of the 'onNotification'</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"> I always used it as a globla function, like:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div><a href="https://gist.github.com/matzew/ea739b09b3fbef487edd" style="font-family:arial,sans-serif;font-size:13px" target="_blank">https://gist.github.com/matzew/ea739b09b3fbef487edd</a></div>
</div></div></div></blockquote><div><br></div><div>You spotted the issue ! </div><div>Miguel I just tried your code and indeed since the onNotif is not global it isn't called , try to get the same structure as in <a href="https://github.com/aerogear/aerogear-pushplugin-cordova/tree/master/example">https://github.com/aerogear/aerogear-pushplugin-cordova/tree/master/example</a> and it should work.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="">
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"> <br>
}, false);<br><div><div><div><div><div><div><div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">I think I'm answering to all your questions. Any help appreciated.<br>
</div><div class="gmail_quote">Feel free to ask whatever you need to enlighten this situation.<span><font color="#888888"><br><br></font></span></div><span><font color="#888888"><div class="gmail_quote">
Miguel<br><br></div><div class="gmail_quote"><br></div><br></font></span></div></div></div></div></div>
</div></div></div></div></div></div>
</blockquote></div></div><br><br clear="all"><div class=""><div><br></div>-- <br>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div></div>
<br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br></div></div>