GetRegistrationsbychannelasync method not working

Cherry007 20 Reputation points
2024-05-31T17:49:54.73+00:00

Hi, as per firebase update for push notifications and registering devices I have enabled and moved to FCMV1. At Azure notification hub I have provided the fcmv1 details private key, client email, project id.

After given these details I tried to run the code at Visual studio 2019 using Azure notification hub library 4.2.0. Debugged at stack trace System threw an error like task collection result……401 unauthorised at GetRegistrationsbyChannelasync method. Earlier same code work for the previous option GCM (provided API key at azure notifications hub)on the same account ProjectID.

my fcmv1 credentials like private key, client id… mentioned in azure notification hub are wrong? Please help me out in this.

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.
282 questions
{count} votes

Accepted answer
  1. Gulnaz Mushtaq 330 Reputation points MVP
    2024-05-31T19:18:45.1633333+00:00

    It seems you’re encountering a 401 Unauthorized error when trying to use FCM V1 with Azure Notification Hub. Verify that the API Key you provided in Azure Notification Hub is a Server Key. If it’s not, you might need to create a new one specifically for server-side use. Make sure you’ve correctly configured the FCM V1 credentials (private key, client ID, etc.) in Azure Notification Hub.

    Ensure that the Authorization rules are correctly set up for your Notification Hub. If they are missing, add the necessary rules in the Azure portal. Copy the corresponding connection string from the portal and use it with the Notification Hub Android API. Use the Azure portal’s “Test Send” feature to verify if notifications are working correctly. This will help you identify any issues related to your configuration.

    0 comments No comments

0 additional answers

Sort by: Most helpful