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.
3 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.
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.
Using Server explorer is Visual Studio:
- Connect to azure from Server Explorer.
- Find Notifiction Hub section.
- Select your hub.
- right side, your will see two tabs. Test Send and Device Registration.
- On "Device Registration" tab you will see list of registrations. You can edit or delete it.
Using C# code:
var allRegistrations = await Notifications.Instance.Hub.GetAllRegistrationsAsync(0);