FcmNotification Properties Needed For Android Delivery?

Marc George 171 Reputation points
2021-08-16T10:05:51.097+00:00

Using Azure Notification Hubs through a NotificationRequestHandler call to send a FcmNotification to an registered Android app, what are the minimal properties needed to be set beyond the notice itself?

My understanding is that the Sender ID, Package name, App ID and Channel name are necessary. Are they a part of the notice like below which Firebase accepts? Or should they be added as headers in the class object? I can send the notification to the app via the Firebase console itself successfully.

{\"Sender: id=(0)\":\"201xxxxxx6\",\"notification\":{\"appid\":\"1:201x6:android:3fXXXfb\",},\"data\":{ \"req\":\"497f7c7c8\"},\"android\":{\"channel_id\":\"channel\",\"restricted_package_name\":\"com.xxx.app\",\"priority\":\"normal\"},}

Azure Notification Hubs
Azure Notification Hubs
An Azure service that is used to send push notifications to all major platforms from the cloud or on-premises environments.
262 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 18,286 Reputation points
    2021-08-17T19:06:14.377+00:00

    Thanks for asking question! We are simply a pass-through to Firebase directly. If you can send that body through Firebase, then you should be able to send it through us. We are using the Legacy FCM endpoint, so anything valid here is sent along Firebase Cloud Messaging HTTP protocol (google.com)

    A message can be either a notification message or data message as we have on our portal for test-send.

    {
        "notification":{
            "title":"Notification Hub Test Notification",
            "body":"This is a sample notification delivered by Azure Notification Hubs."
        },
        "data":{
            "property1":"value1",
            "property2":42
        }
    }
    

    Nothing more than that should be required.

    Let us know if further query or issue remains.