caffeinalab / ti.goosh

GCM/FCM module for Titanium.
MIT License
52 stars 34 forks source link

Crash report from Google Play #107

Closed mark22 closed 6 years ago

mark22 commented 6 years ago

Ive started to get this crash report with 4.1.0

Any ideas where to begin to track down the problem?

java.lang.ClassCastException: at com.google.gson.JsonObject.getAsJsonPrimitive (JsonObject.java:185) at ti.goosh.IntentService.parseNotification (IntentService.java:122) at ti.goosh.IntentService.onMessageReceived (IntentService.java:55) at com.google.android.gms.gcm.GcmListenerService.handleIntent (Unknown Source) at com.google.firebase.iid.zzc.run (Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:607) at java.lang.Thread.run (Thread.java:762)

progress44 commented 6 years ago

Line 122 of InstanService contains the following piece of code

if (data != null && data.has("alert")) {
    alert = data.getAsJsonPrimitive("alert").getAsString();
}

It means that the alert key exists in the payload and it has some data but the data isn't a primitive. It is probably an object of some kind which means that the payload is not formatted correctly