Not receiving Firebase Cloud Messaging Notificatio

2019-07-27 08:27发布

问题:

I'm using Xamarin to create a Simple Android Application that receives Push Notifications from Firebase Cloud Messaging.

I Followed Xamarin's Documentation to implement this function.

And followed it step by step until the section that reads:

Background Notifications

I tapped the Log Token Button and received the token.

The next step is to send the notification from Firebase Console, but the notification never gets to the emulator after sending it and no error is logged on Firebase nor the Xamarin console.

The Firebase console displays the message as 'Completed'.

What am I missing to resolve this issue?

回答1:

Messages sent from the Firebase Notifications console are treated as notification-only message payloads (unless you add in a custom key-value pair, then it becomes a notification and data together).

notification-only message payload behavior is when the app is in background, the Android System will handle the notification. See Handling Messages for Android for more details on the behavior.