Aerogear android crash on push notification receive

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Aerogear android crash on push notification receive

faisakhtar
Hi,

I am trying to send push notifications to an android device using the Cordova Aerogear Push Plugin (3.0.0) and Unified Push Server. The push notification appears to be sent ok from the server however upon receipt on the device an error is thrown stating that the app has stopped working.

When I try to send a push notification using a HTTP POST direct to GCM for our application the push notification appears fine on the device. But when we send a push notification through the Aerogear Unified Push Server using the "Send notification to this app" wizard or the REST API they both throw an error on the device.

The same setup actually worked fine about 4 weeks ago, have the changes with GCM/FCM resulted in issues related to app crashes?

Below is a log output showing the error on the device.

08-05 12:32:23.202: D/NotificationMessage(14698): onMessage - context: android.app.Application@fe58355
08-05 12:32:23.203: W/Bundle(14698): Key google.sent_time expected String but value was a java.lang.Long.  The default value <null> was returned.
08-05 12:32:23.203: W/Bundle(14698): Attempt to cast generated internal exception:
08-05 12:32:23.203: W/Bundle(14698): java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
08-05 12:32:23.203: W/Bundle(14698): at android.os.BaseBundle.getString(BaseBundle.java:923)
08-05 12:32:23.203: W/Bundle(14698): at org.jboss.aerogear.cordova.push.Message.<init>(Message.java:46)
08-05 12:32:23.203: W/Bundle(14698): at org.jboss.aerogear.cordova.push.NotificationMessageHandler.createNotification(NotificationMessageHandler.java:66)
08-05 12:32:23.203: W/Bundle(14698): at org.jboss.aerogear.cordova.push.NotificationMessageHandler.onMessage(NotificationMessageHandler.java:55)
08-05 12:32:23.203: W/Bundle(14698): at org.jboss.aerogear.android.unifiedpush.RegistrarManager$2.run(RegistrarManager.java:177)
08-05 12:32:23.203: W/Bundle(14698): at java.lang.Thread.run(Thread.java:818)
08-05 12:32:23.267: E/AndroidRuntime(14698): FATAL EXCEPTION: Thread-22055
08-05 12:32:23.267: E/AndroidRuntime(14698): Process: com.companyname.appname, PID: 14698
08-05 12:32:23.267: E/AndroidRuntime(14698): Theme: themes:{default=overlay:system, iconPack:system, fontPkg:system, com.android.systemui=overlay:system, com.android.systemui.navbar=overlay:system}
08-05 12:32:23.267: E/AndroidRuntime(14698): com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.Gson.fromJson(Gson.java:795)
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.Gson.fromJson(Gson.java:859)
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.Gson.fromJson(Gson.java:832)
08-05 12:32:23.267: E/AndroidRuntime(14698): at org.jboss.aerogear.android.store.sql.SQLStore.readAll(SQLStore.java:110)
08-05 12:32:23.267: E/AndroidRuntime(14698): at org.jboss.aerogear.cordova.push.NotificationMessageHandler.createNotification(NotificationMessageHandler.java:84)
08-05 12:32:23.267: E/AndroidRuntime(14698): at org.jboss.aerogear.cordova.push.NotificationMessageHandler.onMessage(NotificationMessageHandler.java:55)
08-05 12:32:23.267: E/AndroidRuntime(14698): at org.jboss.aerogear.android.unifiedpush.RegistrarManager$2.run(RegistrarManager.java:177)
08-05 12:32:23.267: E/AndroidRuntime(14698): at java.lang.Thread.run(Thread.java:818)
08-05 12:32:23.267: E/AndroidRuntime(14698): Caused by: java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.internal.bind.JsonTreeReader.nextString(JsonTreeReader.java:154)
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.internal.bind.TypeAdapters$13.read(TypeAdapters.java:349)
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.internal.bind.TypeAdapters$13.read(TypeAdapters.java:337)
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:188)
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:146)
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93)
08-05 12:32:23.267: E/AndroidRuntime(14698): at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172)
Reply | Threaded
Open this post in threaded view
|

Re: Aerogear android crash on push notification receive

faisakhtar
I have also found others who experienced a very similar issue (although not with Aerogear):
https://github.com/morinel/gcmpush/issues/45

Does Aerogear have to release a patch to remedy this?
Reply | Threaded
Open this post in threaded view
|

Re: [Aerogear-users] Aerogear android crash on push notification receive

Erik Jan de Wit
it seems there is a 'google.sent_time' property in your user data that is a long instead of the expected string. There is currently no fix for this available would you mind creating an issue for it with your log attached?

On Mon, Aug 8, 2016 at 3:07 PM, faisakhtar <[hidden email]> wrote:
I have also found others who experienced a very similar issue (although not
with Aerogear):
https://github.com/morinel/gcmpush/issues/45

Does Aerogear have to release a patch to remedy this?



--
View this message in context: http://aerogear-users.1116366.n5.nabble.com/Aerogear-android-crash-on-push-notification-receive-tp787p788.html
Sent from the aerogear-users mailing list archive at Nabble.com.
_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



--
Cheers,
       Erik Jan

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

[Aerogear-users] Register and Alias

Christopher Fahey
Now that everything is running smoothly I have a couple of questions
regarding register.

Does register need to be called each time the app starts up?

Why isn't the alias at the server updated with the alias supplied during
subsequent register calls from the same installed app?  I would like to
have the most current email address used as an alias but changing it
after the initial register has no effect on the device listings.

Thanks for everyone's help.

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

Re: [Aerogear-users] Register and Alias

Christopher Fahey

Please disregard my question regarding Register. I didn't RTFM.    However, I am still wondering about the updating of Alias.  The manual seems to indicate it should be updated.

Thanks.


Christopher Fahey
DealerRewards, Inc.
Maryland Branch Office
(410) 924-3185

This electronic message transmission contains information from DealerRewards Inc. This message is confidential. It may also be privileged or otherwise protected by work-product immunity or other legal rules. If you have received it by mistake, please let us know by email reply and delete it from your system; you may not copy this message or disclose its contents to anyone.
DISCLAIMER: Since 2006, the U.S. Government has been monitoring all internet communications. If you have information that you do not wish to have monitored, please send it using regular postal services to the address listed on our website.
On 8/22/2016 4:12 PM, Christopher Fahey wrote:
Now that everything is running smoothly I have a couple of questions 
regarding register.

Does register need to be called each time the app starts up?

Why isn't the alias at the server updated with the alias supplied during 
subsequent register calls from the same installed app?  I would like to 
have the most current email address used as an alias but changing it 
after the initial register has no effect on the device listings.

Thanks for everyone's help.

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

Re: [Aerogear-users] Register and Alias

Matthias Wessendorf
In reply to this post by Christopher Fahey


On Mon, Aug 22, 2016 at 10:12 PM, Christopher Fahey <[hidden email]> wrote:
Now that everything is running smoothly I have a couple of questions
regarding register.

Does register need to be called each time the app starts up?

Why isn't the alias at the server updated with the alias supplied during
subsequent register calls from the same installed app? 

Hrm, it should be updated, however I do recall we had a bug in this area before.

Let me find a PR/JIRA or something, than I will get more details

 
I would like to
have the most current email address used as an alias but changing it
after the initial register has no effect on the device listings.

Thanks for everyone's help.

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



--

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

Re: [Aerogear-users] Register and Alias

Matthias Wessendorf
Christopher,

what's the version of your AeroGear-Cordova Push Plugin?



On Tue, Aug 23, 2016 at 8:26 AM, Matthias Wessendorf <[hidden email]> wrote:


On Mon, Aug 22, 2016 at 10:12 PM, Christopher Fahey <[hidden email]> wrote:
Now that everything is running smoothly I have a couple of questions
regarding register.

Does register need to be called each time the app starts up?

Why isn't the alias at the server updated with the alias supplied during
subsequent register calls from the same installed app? 

Hrm, it should be updated, however I do recall we had a bug in this area before.

Let me find a PR/JIRA or something, than I will get more details

 
I would like to
have the most current email address used as an alias but changing it
after the initial register has no effect on the device listings.

Thanks for everyone's help.

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



--



--

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

Re: [Aerogear-users] Register and Alias

Christopher Fahey

I believe it is 1-1-0-Final.  I couldn't find a version id in the files that made up the package.


Christopher Fahey
DealerRewards, Inc.
Maryland Branch Office
(410) 924-3185

This electronic message transmission contains information from DealerRewards Inc. This message is confidential. It may also be privileged or otherwise protected by work-product immunity or other legal rules. If you have received it by mistake, please let us know by email reply and delete it from your system; you may not copy this message or disclose its contents to anyone.
DISCLAIMER: Since 2006, the U.S. Government has been monitoring all internet communications. If you have information that you do not wish to have monitored, please send it using regular postal services to the address listed on our website.
On 8/23/2016 5:21 AM, Matthias Wessendorf wrote:
Christopher,

what's the version of your AeroGear-Cordova Push Plugin?



On Tue, Aug 23, 2016 at 8:26 AM, Matthias Wessendorf <[hidden email]> wrote:


On Mon, Aug 22, 2016 at 10:12 PM, Christopher Fahey <[hidden email]> wrote:
Now that everything is running smoothly I have a couple of questions
regarding register.

Does register need to be called each time the app starts up?

Why isn't the alias at the server updated with the alias supplied during
subsequent register calls from the same installed app? 

Hrm, it should be updated, however I do recall we had a bug in this area before.

Let me find a PR/JIRA or something, than I will get more details

 
I would like to
have the most current email address used as an alias but changing it
after the initial register has no effect on the device listings.

Thanks for everyone's help.

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



--



--


_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users


_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

Re: [Aerogear-users] Aerogear android crash on push notification receive

Matthias Wessendorf
In reply to this post by Erik Jan de Wit
Hello,

I've now created this Cordova JIRA:

On Thu, Aug 18, 2016 at 2:05 PM, Erik Jan de Wit <[hidden email]> wrote:
it seems there is a 'google.sent_time' property in your user data that is a long instead of the expected string. There is currently no fix for this available would you mind creating an issue for it with your log attached?

On Mon, Aug 8, 2016 at 3:07 PM, faisakhtar <[hidden email]> wrote:
I have also found others who experienced a very similar issue (although not
with Aerogear):
https://github.com/morinel/gcmpush/issues/45

Does Aerogear have to release a patch to remedy this?



--
View this message in context: http://aerogear-users.1116366.n5.nabble.com/Aerogear-android-crash-on-push-notification-receive-tp787p788.html
Sent from the aerogear-users mailing list archive at Nabble.com.
_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



--
Cheers,
       Erik Jan

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users




--

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

Re: [Aerogear-users] Aerogear android crash on push notification receive

Matthias Wessendorf
Hello,

while I am unable to reproduce it (Android 6.0.1), I've applied the suggested fix to my branch:

The commit is here:


you can test the branch, by removing the plugin:
* cordova plugin remove aerogear-cordova-push

and afterwards just add my branch:
* cordova plugin add <a href="https://github.com/matzew/aerogear-pushplugin-cordova\#ClassCastCrash">https://github.com/matzew/aerogear-pushplugin-cordova\#ClassCastCrash

Now, just run "cordova run android"

Thanks,
Matthias


On Wed, Aug 31, 2016 at 4:49 PM, Matthias Wessendorf <[hidden email]> wrote:
Hello,

I've now created this Cordova JIRA:

On Thu, Aug 18, 2016 at 2:05 PM, Erik Jan de Wit <[hidden email]> wrote:
it seems there is a 'google.sent_time' property in your user data that is a long instead of the expected string. There is currently no fix for this available would you mind creating an issue for it with your log attached?

On Mon, Aug 8, 2016 at 3:07 PM, faisakhtar <[hidden email]> wrote:
I have also found others who experienced a very similar issue (although not
with Aerogear):
https://github.com/morinel/gcmpush/issues/45

Does Aerogear have to release a patch to remedy this?



--
View this message in context: http://aerogear-users.1116366.n5.nabble.com/Aerogear-android-crash-on-push-notification-receive-tp787p788.html
Sent from the aerogear-users mailing list archive at Nabble.com.
_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



--
Cheers,
       Erik Jan

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users




--



--

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users