Multiple channels on Android

Krunal Berawala 1 Reputation point
2021-01-15T05:23:56.447+00:00

I am using azure notification hub for sending push notifications to android and ios.

On Android devices 2 notification "Channel" created with different config for sound/lights/vibration.

what should be the payload to deliver message to specific channel and notification would behave according to the channel ?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,301 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,951 Reputation points
    2021-01-15T08:11:08.953+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    what should be the payload to deliver message to specific channel and notification would behave according to the channel ?

    For this function, try creating a custom FirebaseService class to inherit from the FirebaseMessagingService interface and override the OnMessageReceived method to handle the message. Before this, you need to add an identifier to the message, such as adding a prefix or suffix to the text content. Then detect the message in OnMessageReceived method to send the local notification with a channel.

    Check the tutorial:
    https://learn.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-push-notifications-android-gcm#send-test-notification-from-the-azure-portal

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.