-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App crashes when receiving Push (FCM) #35
Comments
Try a payload as in the example I just committed here 37c9ce7 The module expects a |
Fixes a crash that happens when you don't send a `data` object. Stack trace: ``` [INFO] I/ti.goosh.IntentService: Not showing notification cause missing data.alert [ERROR] AndroidRuntime: FATAL EXCEPTION: AsyncTask caffeinalab#5 [ERROR] AndroidRuntime: Process: com.fanhero.floridacup, PID: 32621 [ERROR] AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.gson.JsonObject.has(java.lang.String)' on a null object reference [ERROR] AndroidRuntime: at ti.goosh.IntentService.parseNotification(IntentService.java:122) [ERROR] AndroidRuntime: at ti.goosh.IntentService.onMessageReceived(IntentService.java:54) [ERROR] AndroidRuntime: at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source) [ERROR] AndroidRuntime: at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source) [ERROR] AndroidRuntime: at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source) [ERROR] AndroidRuntime: at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source) [ERROR] AndroidRuntime: at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source) [ERROR] AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) [ERROR] AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) [ERROR] AndroidRuntime: at java.lang.Thread.run(Thread.java:818) ```
Hi,
since FCM is "the future" I think we need a solution for this, so we can work with it :)
If i send a test notification over FCM my app crashes.
[ERROR] : TiApplication: (AsyncTask #3) [56387,57328] Sending event: exception on thread: AsyncTask #3 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.gson.JsonObject.has(java.lang.String)' on a null object reference; Titanium 6.0.1,2016/12/19 16:51,undefined [ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.gson.JsonObject.has(java.lang.String)' on a null object reference [ERROR] : TiApplication: at ti.goosh.IntentService.parseNotification(IntentService.java:122) [ERROR] : TiApplication: at ti.goosh.IntentService.onMessageReceived(IntentService.java:54) [ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source) [ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source) [ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source) [ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source) [ERROR] : TiApplication: at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
Not sure how to set the "alert" object, since there is no such input on the fcm page. Just Keypairs. Any help would be great.
The text was updated successfully, but these errors were encountered: