Xamarin application not getting registered with Azure Notification Hub

Raihan Iqbal 121 Reputation points
2024-02-13T05:23:08.46+00:00

Hi all, I've been following this guide, albeit a bit outdated, to set up the backend services and register them with Azure Notification Hubs.

Google: Azure automatically verifies the API Key when I click on Save so does that mean I have set up Firebase correctly? User's image

For the project setup, I decided to follow this guide instead as it uses official Nuget packages to handle registration and notifications as opposed to custom code. In my Xamarin application startup app class, I've registered Notification Hub however my emulator doesn't get registered in Azure

public partial class App: Application
{
	public App()
	{
		// Azure Notification Hub
		NotificationHub.Start("Endpoint=sb://....", "My-App-NH");
		NotificationHub.AddTags(new[] { "DeveloperDevices" });
		NotificationHub.NotificationMessageReceived += (sender, args) =>
		{
		    Debug.WriteLine("Message received");
		};
		NotificationHub.InstallationSaved += (sender, e) =>
		{
		    Debug.WriteLine($"Installation ID: {e.Installation.InstallationId} saved successfully");
		};
		NotificationHub.InstallationSaveFailed += (sender, e) =>
		{
		    Debug.WriteLine($"Failed to save installation: {e.Exception.Message}");
		};
	}
}
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.
289 questions
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,319 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 19,676 Reputation points
    2024-02-14T16:29:56.5566667+00:00

    @Raihan Iqbal Thanks for asking question! Could you look for error information about the failed delivery attempt against a registration, you can use the Notification Hubs REST APIs

    Per Message Telemetry: Get Notification message telemetry and PNS feedback.

    For sample code, see the Send REST example.

    Let us know.

    0 comments No comments