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)
--
View this message in context:
http://aerogear-users.1116366.n5.nabble.com/Aerogear-android-crash-on-pus...
Sent from the aerogear-users mailing list archive at
Nabble.com.