You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Push notifications are properly received when the app is in background, however if the app is currently active - no messages will be received with the following warning messages being thrown:
Key google.sent_time expected String but value was a java.lang.Long. The default value <null> was returned.
Attempt to cast generated internal exception:
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
at android.os.BaseBundle.getString(BaseBundle.java:1089)
at com.google.android.gms.gcm.zza.zzr(Unknown Source:25)
at com.google.android.gms.gcm.GcmListenerService.handleIntent(Unknown Source:201)
at com.google.firebase.iid.zzg.run(Unknown Source:29)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Key google.ttl expected String but value was a java.lang.Integer. The default value <null> was returned.
Attempt to cast generated internal exception:
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at android.os.BaseBundle.getString(BaseBundle.java:1089)
at com.google.android.gms.gcm.zza.zzr(Unknown Source:25)
at com.google.android.gms.gcm.GcmListenerService.handleIntent(Unknown Source:201)
at com.google.firebase.iid.zzg.run(Unknown Source:29)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
In the above attempt, a MyGcmListenerService which extends GcmListenerService() was implemented in order to handle incoming push notifications under an overridden onMessageReceived() method when the app is on. (edited)
I then followed the doc at firebase.com, implemented a customised FirebaseMessagingService() and have the push notifications received and handled successfully when the app is on. In this attempt, I have removed those skygear-related configs from AndroidManifest.xml and applied some changes in my app gradle:
I am wondering if implementing com.google.firebase:firebase-messaging will handle push notifications for the users, without requiring them to implement FCM related things on their own?
The text was updated successfully, but these errors were encountered:
carmenlau
changed the title
Allow the guides to setup push notification fail to get message in onMessageReceived when user is inside the application
Follow the guides to setup push notification fail to get message in onMessageReceived when user is inside the application
Jun 28, 2018
Android SDK: 1.5.0
Setup notification guides: https://docs.skygear.io/guides/push-notifications/basics/android/
User report
Push notifications are properly received when the app is in background, however if the app is currently active - no messages will be received with the following warning messages being thrown:
In the above attempt, a
MyGcmListenerService
which extendsGcmListenerService()
was implemented in order to handle incoming push notifications under an overriddenonMessageReceived()
method when the app is on. (edited)I then followed the doc at firebase.com, implemented a customised
FirebaseMessagingService()
and have the push notifications received and handled successfully when the app is on. In this attempt, I have removed those skygear-related configs from AndroidManifest.xml and applied some changes in my app gradle:According to my understanding, since GCM is now migrated to FCM,
GcmListenerService
is now deprecated (ref: https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmListenerService) which results in the above warnings being thrown, whereFirebaseMessagingService
is the replacement.Below is a dependency tree of Skygear Android SDK 1.5.0:
I am wondering if implementing
com.google.firebase:firebase-messaging
will handle push notifications for the users, without requiring them to implement FCM related things on their own?The text was updated successfully, but these errors were encountered: