Does RemoteMessage.GetNotification () return null if the request is not from the Firebase Console?

I am testing Firebase Cloud Messaging.

If I use the Firebase Console to send a message - in my code I am a Notification Object with the values ​​set - no problem:

public override void OnMessageReceived(RemoteMessage message)
    {
        base.OnMessageReceived(message);

        Firebase.Messaging.RemoteMessage.Notification oNotification;

        oNotification = message.GetNotification();

I use http://requestmaker.com/ to send a notification - and everything works fine - it is sent, and I return the messageID.

POST /fcm/send HTTP/1.1
Host: fcm.googleapis.com
Accept: */*
Authorization: key=not-a-real-key0omClYhniZaIAercMVzeFHEG508USi8lud9pxC-SzxAAbR2mflAfVNsfrbrsPJxoFYTr15ytRn9aqWSQXm5x00AOwu2Wl6mWwTcm9l6G
Content-Length: 188
Content-Type: application/x-www-form-urlencoded

But oNotification = message.GetNotification();returns null. Questions: why?

+4
source share
1 answer

, data notification. Firebase Console notification ( , "-" Advance). . FCM.

, data - requestmaker. notification :

message.GetNotification();

Android Xamarin, , , FCM, data, RemoteMessage.getData(), data - .

+4

Source: https://habr.com/ru/post/1668333/


All Articles