<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">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</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">&lt;<a href="mailto:miguel21op@gmail.com" target="_blank">miguel21op@gmail.com</a>&gt;</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 &gt; 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 &gt;  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&#39;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 &gt; The Android version I use on the testing device: 4.2.1 and Cordova 3.3<br>


<br></div>4 &gt; 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&#39;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&gt; 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&#39;ll generate new ones);<br>



<br></div>6 &gt; Please see attached the libraries I&#39;m using on my Android app;<br><br></div>7 &gt;  The Javascript code inside my app:<br><br>document.addEventListener(&#39;deviceready&#39;, function(){<br>    <br>    var pushConfig = {                      // credentials not real; I thing this goes live...<br>


          senderID: &quot;278695548260&quot;,<br>          pushServerURL: &quot;<a href="https://aerogear-metalpush.rhcloud.com" target="_blank">https://aerogear-metalpush.rhcloud.com</a>&quot;, <br>          variantID: &quot;821460c5-ez9f-41d8-903a-61e7bd132038&quot;,<br>


          variantSecret: &quot;43b0e5e4-f217-4f29-b15b-85f8f5748ee6&quot;<br>        }<br> <br>    try {<br>      push.register(successHandler, errorHandler, {&quot;badge&quot;: &quot;true&quot;, &quot;sound&quot;: &quot;true&quot;,<br>


        &quot;alert&quot;: &quot;true&quot;, &quot;ecb&quot;: &quot;onNotification&quot;, pushConfig: pushConfig});<br>        <br>    } catch (err) {<br>      txt = &quot;Erro encontrado.\n\n&quot;;<br>      txt += &quot;Descrição do erro: &quot; + err.message + &quot;\n\n&quot;;<br>


      alert(txt);<br>    }<br><br>    function successHandler(result) {<br>     var respush = document.getElementById(&quot;pushst&quot;);<br>     respush.innerHTML = &quot;Notificações: registo efetuado&quot;;<br>  }<br>


<br>  function errorHandler(error) {<br>    var respush = document.getElementById(&quot;pushst&quot;);<br>     respush.innerHTML = &quot;Notificções: registo falhado&quot;;<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 &#39;onNotification&#39;</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&#39;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&#39;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>