<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 20, 2017 at 6:08 AM, Federico Cerminara <span dir="ltr">&lt;<a href="mailto:fedecentrico@gmail.com" target="_blank">fedecentrico@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Hi Summers,<br></div>first of all, i&#39;d like to thank you for your precious suggestion.<br></div><div>I managed to launch my app using Android Emulator and together with the logcat tool.<br></div><div>Thanks to this new approach, i was able to take some lines from the logcat stacktrace and now i can share them in the following.<br><br><i>04-20 11:35:44.861 31658 31658 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.jboss.<wbr>aerogear.android.cookbook.<wbr>aerodoc/org.jboss.aerogear.<wbr>cordova.push.<wbr>PushHandlerActivity}: java.lang.<wbr>NullPointerException: Attempt to invoke interface method &#39;java.util.Collection org.jboss.aerogear.android.<wbr>store.Store.readAll()&#39; on a null object reference<br><br>... ... ... <br><br>04-20 11:35:44.861 31658 31658 E AndroidRuntime: Caused by: java.lang.<wbr>NullPointerException: Attempt to invoke interface method &#39;java.util.Collection org.jboss.aerogear.android.<wbr>store.Store.readAll()&#39; on a null object reference<br><br>04-20 11:35:44.861 31658 31658 E AndroidRuntime:     at org.jboss.aerogear.cordova.<wbr>push.PushHandlerActivity.<wbr>processPushBundle(<wbr>PushHandlerActivity.java:60)<br><br>04-20 11:35:44.861 31658 31658 E AndroidRuntime:     at org.jboss.aerogear.cordova.<wbr>push.PushHandlerActivity.<wbr>onCreate(PushHandlerActivity.<wbr>java:45)<br><br>04-20 11:35:44.861 31658 31658 E AndroidRuntime:     at android.app.Activity.<wbr>performCreate(Activity.java:<wbr>6876)<br><br>04-20 11:35:44.861 31658 31658 E AndroidRuntime:     at android.app.Instrumentation.<wbr>callActivityOnCreate(<wbr>Instrumentation.java:1135)<br><br>04-20 11:35:44.861 31658 31658 E AndroidRuntime:     at android.app.ActivityThread.<wbr>performLaunchActivity(<wbr>ActivityThread.java:3207)<br><br>04-20 11:35:44.861 31658 31658 E AndroidRuntime:     ... 9 more<br></i><br></div><div><span lang="EN-US"> As i wrote in the first mail, this is the app crash scenario. If I
have my app closed or already open, clicking on push notification seems to
behave correctly, bringing user to application first page. Instead, if I try to
close all my applications after receiving one or more push notification (image
notification frequency is quite low) and then I try to click on my waiting
push, application crashes showing a message that sound quite like this “The
program &lt;app_name&gt; has been interrupted”<br><br></span></div><div><span lang="EN-US">Reading the log stacktrace, it seems like there&#39;s a NPE in </span><i>PushHandlerActivity.java:60</i>, and more precisely when it tries to read the store content.<br></div><div>Now, I don&#39;t know if it&#39;s the right place to face the problem, of if I should open a ticket somewhere else, or if it&#39;s an already known and solved bug, or if eventually it&#39;s some kind of problem related to a wrong configuration in my app. Before losing me in all this wondering, can you suggest me what to do? Could i try directly to change the java code in the class PushHandlerActivity? Should it have effect, also eventually to make a test locally? <br><br></div></div></blockquote><div><br></div><div>So 1) I think we have this bug known already (<a href="https://issues.jboss.org/browse/AGCORDOVA-167">https://issues.jboss.org/browse/AGCORDOVA-167</a>), sorry about that.  </div><div><br></div><div>2) If you are feeling brave you can add the null/initialization check from here : </div><div><br></div><div>   <a href="https://github.com/aerogear/aerogear-cordova-push/blob/b313fcfb20708089f2e0bcb871e396f67ee2b1a5/src/android/org/jboss/aerogear/cordova/push/NotificationMessageHandler.java#L43">https://github.com/aerogear/aerogear-cordova-push/blob/b313fcfb20708089f2e0bcb871e396f67ee2b1a5/src/android/org/jboss/aerogear/cordova/push/NotificationMessageHandler.java#L43</a><br></div><div><br></div><div>to here : </div><div><br></div><div>  <a href="https://github.com/aerogear/aerogear-cordova-push/blob/b313fcfb20708089f2e0bcb871e396f67ee2b1a5/src/android/org/jboss/aerogear/cordova/push/PushHandlerActivity.java#L60">https://github.com/aerogear/aerogear-cordova-push/blob/b313fcfb20708089f2e0bcb871e396f67ee2b1a5/src/android/org/jboss/aerogear/cordova/push/PushHandlerActivity.java#L60</a></div><div><br></div><div>rebuild the cordova library, test it, and send a pull request if it fixes your problem.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>Here some information about my test conditions which could be useful.<br><br></div><div>OS: Android 6.0.1<br></div><div>Device: Samsung S6<br></div><div>Aerogear Plugin Version: 3.1.0<br><br></div><div>We&#39;re talking about a cross platform application developed with Ionic 1 and Angular 1.<br></div><div>I did not try to verify if the problem is happening also on a iOS device, but i&#39;m gonna do it immediately after writing this reply.<br></div><div>Do you think some other info could be useful?<br><br></div><span lang="EN-US">Thanks anyway, Federico.</span><div><br></div><br><div><br></div></div><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-04-19 13:37 GMT+02:00 Summers Pittman <span dir="ltr">&lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The easiest tool to use is logcat with the Android emulator.  Logcat is part of the Android SDK which you installed while you were setting up your development environment (it may have been installed by another tool but it is there).<div><br></div><div>All you need to do is, from the command line, run logcat.  Then run your application and wait for it to crash, and you will find the stack trace (and a bunch of other stuff), in the log.  It is possible to filter the logcat output based on the package name of the application generating logs, but one thing at a time.</div><span class="gmail-m_-7201539192057589537HOEnZb"><font color="#888888"><div><br></div><div>Summers</div></font></span></div><div class="gmail-m_-7201539192057589537HOEnZb"><div class="gmail-m_-7201539192057589537h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 19, 2017 at 4:11 AM, Federico Cerminara <span dir="ltr">&lt;<a href="mailto:fedecentrico@gmail.com" target="_blank">fedecentrico@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font size="4">Still not able to introduce a tool to produce a stacktrace. I know it would be helpful (if you have suggestions about which tool/plugin/approach to use...) but now i am still not able to do it. </font><span lang="EN-US"><font size="4">I’m a beginner in cross platform app development, as i said before :(</font><br></span></div><div class="gmail-m_-7201539192057589537m_8436308783065595146HOEnZb"><div class="gmail-m_-7201539192057589537m_8436308783065595146h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-04-18 17:23 GMT+02:00 Summers Pittman <span dir="ltr">&lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Apr 18, 2017 at 10:55 AM, Federico Cerminara <span dir="ltr">&lt;<a href="mailto:fedecentrico@gmail.com" target="_blank">fedecentrico@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Hi Summers, <br></div>thanks for your immediate reply. The OS on the device i am testing now is Android 6.0.1, but I don&#39;t know if it&#39;s an useful information cause I&#39;m using Ionic 1 and Angular 1 to develop a Cross Platform App. <br><br></div><div>The code is not publicly available but I can share some code pieces if you suggest me which pieces of code could help us for this analysis.<br><br></div><div>It&#39;s not ax example app, I just took inspiration from the snippet of code included in Android aerogear variant and used them to complete my app.js code.  <br><br></div><div>How could you help me?<br></div></div></blockquote><div><br></div></span><div>Would you be able to include your stack trace from logcat when the application crashes?</div><div><br></div><div>I&#39;m not as familiar with Cordova as I should be, but I should be able to make heads or tails of it.</div><div><div class="gmail-m_-7201539192057589537m_8436308783065595146m_-8515675144550618316h5"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>Thanks anyway, Federico.<br><br></div></div><div class="gmail_extra"><div><div class="gmail-m_-7201539192057589537m_8436308783065595146m_-8515675144550618316m_-1928189413010546042h5"><br><div class="gmail_quote">2017-04-18 16:33 GMT+02:00 Summers Pittman <span dir="ltr">&lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Frederico,<div><br></div><div>Hi, sorry you are having trouble with UPS.  If you could help us out by answering a couple of questions that would be great.</div><div><br></div><div>1) Which OS is your applicatoin having trouble on and are you using Cordova or native libraries?</div><div><br></div><div>2) Is your code publicly available somewhere for us to look at?</div><div><br></div><div>3) Are you using the example app or is this your own implementation?</div><div><br></div><div>I know from experience that with Android one of the common problems is that if the application has been killed by the OS then the Push libraries have to be reinitialized before you can send metrics to the server.  If you are initializing your push libraries in an Activity class instead of the Application class this may be something to double check.  Of course if this is iOS or Cordova then everything I just said is nonsense :)</div><div><br></div><div>Summers</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="gmail-m_-7201539192057589537m_8436308783065595146m_-8515675144550618316m_-1928189413010546042m_-2482881479116987358h5">On Tue, Apr 18, 2017 at 10:18 AM, Federico Cerminara <span dir="ltr">&lt;<a href="mailto:fedecentrico@gmail.com" target="_blank">fedecentrico@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-m_-7201539192057589537m_8436308783065595146m_-8515675144550618316m_-1928189413010546042m_-2482881479116987358h5"><div dir="ltr">

<p class="MsoNormal"><span lang="EN-US">Hi, <br>
my name is Federico Cerminara, 35 years old, engineer and web developer in
Rome.<br>
I’m a beginner in cross platform app development and I’ve started using
aerogear cordova push plugin to enable reception of push notification. <br>
<br>
I’ve developed my first app. I’m able to receive correctly push notification,
both sending them directly by aerogear admin panel after choosing a variant and
and sending them from the application backend following a custom logic. If I
have my app closed or already open, clicking on push notification seems to
behave correctly, bringing user to application first page. Instead, if I try to
close all my applications after receiving one or more push notification (image
notification frequency is quite low) and then I try to click on my waiting
push, application crashes showing a message that sound quite like this “The
program &lt;app_name&gt; has been interrupted”</span></p>

<p class="MsoNormal"><span lang="EN-US">Can you
tell me a way to solve this problem?<br>
Thanks anyway, Federico.</span></p>

</div>
<br></div></div>______________________________<wbr>_________________<br>
Aerogear-users mailing list<br>
<a href="mailto:Aerogear-users@lists.jboss.org" target="_blank">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/aerogear-users</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Aerogear-users mailing list<br>
<a href="mailto:Aerogear-users@lists.jboss.org" target="_blank">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/aerogear-users</a><br>
<br></blockquote></div><br><br clear="all"><br></div></div><span class="gmail-m_-7201539192057589537m_8436308783065595146m_-8515675144550618316m_-1928189413010546042HOEnZb"><font color="#888888">-- <br><div class="gmail-m_-7201539192057589537m_8436308783065595146m_-8515675144550618316m_-1928189413010546042m_-2482881479116987358gmail_signature"><div dir="ltr"><div>Puoi trovarmi qui, se vuoi:<br><a href="http://www.facebook.com/fedecentrico" target="_blank">facebook</a>, <a href="http://www.flickr.com/photos/fedecentrico" target="_blank">flickr</a>, <a href="http://it.linkedin.com/in/fedecentrico" target="_blank">linkedin</a>, <a href="http://twitter.com/fedecentrico" target="_blank">twitter</a>, <a href="http://www.anobii.com/fedecentrico/books" target="_blank">anobii</a><br>Link consigliati: <a href="http://www.piccolimaestri.org" target="_blank">Piccoli Maestri</a>, <a href="http://www.facebook.com/#%21/IlClimaDiCipro" target="_blank">Il clima di Cipro</a><br></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
Aerogear-users mailing list<br>
<a href="mailto:Aerogear-users@lists.jboss.org" target="_blank">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/aerogear-users</a><br>
<br></blockquote></div></div></div><br></div></div>
<br>______________________________<wbr>_________________<br>
Aerogear-users mailing list<br>
<a href="mailto:Aerogear-users@lists.jboss.org" target="_blank">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/aerogear-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail-m_-7201539192057589537m_8436308783065595146m_-8515675144550618316gmail_signature"><div dir="ltr"><div>Puoi trovarmi qui, se vuoi:<br><a href="http://www.facebook.com/fedecentrico" target="_blank">facebook</a>, <a href="http://www.flickr.com/photos/fedecentrico" target="_blank">flickr</a>, <a href="http://it.linkedin.com/in/fedecentrico" target="_blank">linkedin</a>, <a href="http://twitter.com/fedecentrico" target="_blank">twitter</a>, <a href="http://www.anobii.com/fedecentrico/books" target="_blank">anobii</a><br>Link consigliati: <a href="http://www.piccolimaestri.org" target="_blank">Piccoli Maestri</a>, <a href="http://www.facebook.com/#%21/IlClimaDiCipro" target="_blank">Il clima di Cipro</a><br></div></div></div>
</div>
</div></div><br>______________________________<wbr>_________________<br>
Aerogear-users mailing list<br>
<a href="mailto:Aerogear-users@lists.jboss.org" target="_blank">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/aerogear-users</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Aerogear-users mailing list<br>
<a href="mailto:Aerogear-users@lists.jboss.org" target="_blank">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/aerogear-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail-m_-7201539192057589537gmail_signature"><div dir="ltr"><div>Puoi trovarmi qui, se vuoi:<br><a href="http://www.facebook.com/fedecentrico" target="_blank">facebook</a>, <a href="http://www.flickr.com/photos/fedecentrico" target="_blank">flickr</a>, <a href="http://it.linkedin.com/in/fedecentrico" target="_blank">linkedin</a>, <a href="http://twitter.com/fedecentrico" target="_blank">twitter</a>, <a href="http://www.anobii.com/fedecentrico/books" target="_blank">anobii</a><br>Link consigliati: <a href="http://www.piccolimaestri.org" target="_blank">Piccoli Maestri</a>, <a href="http://www.facebook.com/#%21/IlClimaDiCipro" target="_blank">Il clima di Cipro</a><br></div></div></div>
</div>
</div></div><br>______________________________<wbr>_________________<br>
Aerogear-users mailing list<br>
<a href="mailto:Aerogear-users@lists.jboss.org">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/aerogear-<wbr>users</a><br>
<br></blockquote></div><br></div></div>