Search code examples
push-notificationxamarin.androidazure-notificationhubbaidu

Using Azure Notification Hub with Baidu to send notification to Xamarin Android app


I have developed an Xamarin Android app that successfully do the following things

  1. Can register with Baidu Push
  2. Can receive notification from Baidu Push
  3. Can register with Azure Notification Hub (I can see registration record in the Azure Notification Hub dashboard, but I can see no way to see the detail behind these count)

However when testing with "Test Send" function in Notification Hub, my app won't be able to receive notification.

I confirm that I have put the correct Api Key and Secret Key in Notification Hub > Baidu setting.

So I am stuck in at this point. Anyone have any past experience on this? Appreciate any support / comment / sharing. Thanks!

P.S. I can only see registration count increasing, but I have no way to ensure my registration of device is under Baidu. How can Azure Notification Hub be able to distinguish that my registration token is related to Baidu? The registration code is just a few lines as below

// Register with Notification Hubs
hub = new NotificationHub("Notification_Hub", "MY_HUB_CONNECTION_STRING", context);
var tags = new List<string>() { };
var regID = hub.Register(token, tags.ToArray()).RegistrationId;
Console.WriteLine($"Successful registration of ID {regID}");

Solution

  • Sorry I made a mistake, I should use the following function for Baidu registration. Hope it help some novice like me :o)

    var regID = hub.RegisterBaidu(userId, channelId, someTags);