Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View registrations on Azure Notifications hub

I have created an Azure notifications hub and an API that allows users to register for notifications via the API. This all seems to work without any errors, but I cannot find a way to interrogate the notifications hub for registrations. Can some one tell me how to get a list of all current registrations? Ideally I would just do this in the Azure Portal, but I cannot see anything in there.

like image 843
Slicc Avatar asked Feb 08 '17 14:02

Slicc


People also ask

How do I register my device in Azure notification hub?

You just need to log into Azure portal, choose your App Service, then click "Settings > Push" to configure your Notification Hub. For your Xamarin.

What is tags in Azure notification hub?

Tag expressions enable you to target specific sets of devices, or more specifically registrations, when sending a push notification through Notification Hubs.

How does Azure notification hub work?

Azure Notification Hubs provide an easy-to-use and scaled-out push engine that enables you to send notifications to any platform (iOS, Android, Windows, etc.) from any back-end (cloud or on-premises). Notification Hubs works great for both enterprise and consumer scenarios.

Which of the following security claims sends messages to the notification hub?

Similar to other entities, Notification Hub operations are allowed for three security claims: Listen, Send, and Manage. Notification Hubs accepts SAS tokens generated with shared keys configured directly on the hub. It is not possible to send a notification to more than one namespace.


2 Answers

In Visual Studio, Server Explorer -> unfold your Azure subscription -> Notification Hubs -> find your hub and double click.

In opened window, there is a Device Registrations tab. You can find all your subscribers there.

enter image description here

In the Azure portal, you unfortunately cannot view your subscribers. But you can send a test broadcast message (just don't specify any tags) and see subscribers below in the Result area.

By the way, if you subscribed any devices, then sent a push notification, but payload was wrong or there were any other kind of issues, such subscription could get removed. So you need to check subscriptions before you sent anything.

like image 126
cassandrad Avatar answered Oct 04 '22 22:10

cassandrad


You can use NotificationHubClient.GetAllRegistrationsAsync(int) method [1] to get all registrations.

[1] https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.notificationhubs.notificationhubclient#Microsoft_Azure_NotificationHubs_NotificationHubClient_GetAllRegistrationsAsync_System_Int32_

like image 30
Dmitry P. Avatar answered Oct 04 '22 20:10

Dmitry P.