-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Cannot send to notification centre because there is no 'message' field in: Bundle #1661
Comments
@Dallas62 I'm tagging you directly, believe you will be the best person to help me with this easily. Much appreciated! |
Hi @TommyLeong The linked issue does fit exactly with your case, but this message doesn't make sense now. I recommend you to implement the logic directly in the application. You can take the data from your notification ( |
@Dallas62 That's true, I actually tried to pushed it to local notifications but sometimes im getting twice the same notification (1 frm remote, 1 is the local notifications i pushed)This is probably what you're mentioning here with "avoid loops". However I'm not aware of a way to identify whether the notification is send by server? But yes, via the "userInteraction" key i will know whether if the app is opened by user. |
With RNFirebase/messaging, I don't know how the userInteraction is defined. |
It basically returns a boolean value of true/false. Anything in specific I should look for to identify? |
@Dallas62 with your comment earlier, I've managed to get my notification showed up with
However I realized when app is in killed state, notification does not get passed into this method. But if I view at the logcat from Android Studio, it does received with following..
|
If the notification isn't working/showing, it's probably because there is no channel define. Can you check this ? |
Not really, rmb we had a small discussion on creating custom channel? (: I'm unsure if this has something to do with my payload return, as it does not contain the "priority:high". However, the same payload works for background state (because I trigger |
This comment has been minimized.
This comment has been minimized.
Hi, onNotification: function(notification) {
if(!notification.userInteraction) {
PushNotifications.localNotification(notification.data);
}
} If really needed. |
Question
I don't think this is a library bug, but I need help from the community to confirm about reason why I'm not getting notification banner prompt on device.
Is it because the payload return has
notification object
missing while return, which I assume it's needed by the library to do parsing?Payload received with
messaging().onMessage
methodBelow shows the payload returned from my vendor's portal with the comparison of Firebase
Sent via Vendor Portal
Sent via Firebase Console
===Logs from Android Studio===
Vendor Portal
Here's the log from Android Studio, it mentioned about
D/RNPushNotification: Cannot send to notification centre because there is no 'message' field in: Bundle[
Firebase Console
I believe
onMessageReceived
has somewhat parsed the information in needed format, hence the following is formed. Also, when we compare the following payload with the one above (from Vendor Portal). That's exactly what RNPushNotification is complaining about.Questions
The text was updated successfully, but these errors were encountered: