The Token obtained from the Token Provider is wrong

Hemachandhiran Harimoorthy 0 Reputation points

We are implementing Azure Notification Hub for push notification. We developed React application and obtained fcm token.

We are using C# code backend to registration. Below is the registration code

var fcmInstallation = new Installation
                InstallationId = "<GUID>",
                Platform = NotificationPlatform.Fcm,
                PushChannel = "<Token Received From Firebase>",
                PushChannelExpired = false,
                Tags = new[] { "fcm" },
            await nhClient.CreateOrUpdateInstallationAsync(fcmInstallation);

The registration is successful and I'm able to see the registered devices using
var devices = await nhClient.GetAllRegistrationsAsync(5);

When I try to send test notification from Azure Hub I'm getting error message

"The Token obtained from the Token Provider is wrong".

I verified the server key from firebase and Google(GCM/FCM) API key in Notification Hub. Both are matching.

Not sure what is wrong?

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.
245 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 24,546 Reputation points Microsoft Employee

    Hi @Hemachandhiran Harimoorthy , apologies for the late reply. The error message The Token obtained from the Token Provider is wrong indicates the configured credentials for your Notification Hub is invalid. Looking at your code snippet, the configured PushChannel may not be correct. It should be set to what's returned from PNS/FireBase.

    0 comments No comments