question

MikeV-4658 avatar image
0 Votes"
MikeV-4658 asked ajkuma-MSFT commented

Understand the concept of instllationid and push channels in azure notification hub

After reading the docs on
https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-push-notification-registration-management and https://docs.microsoft.com/en-us/rest/api/notificationhubs/create-overwrite-installation

I am using the restful Api format for notification hub. I understand that I require installation id and push channels and user id to finish the push notification. But the explanation of these three fields does not seem very clear to me.

The senario:
The frontend App will request Apple Push Notification System for a token. Then he will send the token to my backend Api. Then In order to fill in these three fields, should I put the token as the installation Id and put the user's email in database as the user Id? I have no idea where to fetch the content to fill in the push channel field.

Thank you very much!


azure-notification-hubs
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered ajkuma-MSFT commented

@MikeV-4658,

The token from APNS is the push channel. We sometimes also refer to this as the device/PNS handle. Installation ID and user ID are user-defined (as per your requirement/as in your case)
From the 2nd doc’s link you'd shared- “Create or overwrite an installation” – Request body ‘pushChannel’ is ‘The PNS handle for this installation (in case of WNS the ChannelUri of the ApplicationTile).’

You can see the JSON example here:

 { 
     "installationId": "12234", 
     "userID": "MyAmazingUser",
     "tags": ["foo", "bar"], 
     "platform": "apns", 
     "pushChannel": "ABCDEF-123456-…" 
 }

For other related Notification metrics, you may wish to see the thread I'd responded here: decipher metrics



· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MikeV-4658, Additionally, just to highlight on how Notification Hubs pushes notifications to a device:
Also, I have relayed your feedback internally.

In a typical send notification flow, the message is sent from the application back end to Notification Hubs.

1.Notification Hubs processes all the registrations. It takes into account the configured tags and tag expressions to determine targets.
Targets are the registrations that need to receive the push notification

2.With the targets established, Notification Hubs pushes notifications to the push notification service for the device platform. Notification Hubs pushes notifications split across multiple batches of registrations.

3.It authenticates with the respective push notification service, based on the credentials you set in the Azure portal, under Configure Notification Hub.
The push notification service then forwards the notifications to the respective client devices.

4.The final leg of notification delivery is between the platform's push notification service and the device.

Kindly see these docs for more details:

Frequently asked questions
Notification Hubs misconfiguration


1 Vote 1 ·

Great thanks for your answers. Thank you !

0 Votes 0 ·

MikeV-4658, Glad you found the information helpful. Thanks for the update. Much appreciate your great feedback.

0 Votes 0 ·
Show more comments