Notification hub: Installation templates not created again once deleted registrations

Haresh Hanat 1 Reputation point
2021-10-18T05:41:58.917+00:00

Endpoint - PUT https://{namespace}.servicebus.windows.net/{NotificationHub}/installations/{id}

Once the user registers with Device A, We create push notification templates with the above endpoint(Working properly and registering templates): Request body:

{
"installationId": "85c00d7d-1fcb-94ad-a394-59b42b24428d",
"pushChannel": "ckdcS-wPD6Wiv7r2HJls2J4Zr4ocj-nXLHP1iJGNWx7w-FsFkgK7ZpdMEm8k4Eo",
"platform": "gcm",
"templates": {
"mesaageTemplate": {
"body": "{\"data\":{\"notId\":\"#(notId)\",\"title\":\"$(title)\",\"body\":\"$(body)\",\"badge\":\"#(badge)\",\"pageName\":\"$(pageName)\",\"pageParams\":\"$(pageParams)\",\"image\":\"twitter\",\"image-type\":\"circle\",\"style\":\"inbox\"}}",
"tags": [
"User_123456"
]
}
},
"secondaryTiles": {}
}
Again user registers with Device B, we delete the existing templates of that user(Device A) and register new templates for Device B -Working properly.

Again, the User login with Device A, the endpoint is not creating the template registrations in the notification hub. (It is sending the same installation id when user logged in with Device A the first time) - Not Registering

can you suggest a way to resolve 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.
262 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 22,401 Reputation points Microsoft Employee
    2021-11-07T18:28:28.327+00:00

    HareshHanat-1975, Apologies for the delay! Following-up from our discussion in the comments.

    Just to highlight on the difference on installation vs registration: The installation or registration (depending on the API you are using), is tied uniquely to a single device through its Platform Notification Service (PNS) unique ID.

    If you have two devices, this means that you will have two different installations/registrations.

    You shared some insights on your scenario in your previous comment, "we have some cases..," However, we would like to understand more insights/details on your scenario- why the installation/registration will be deleted if the app is installed on a new device and what the requirement is for this functionality?
    Do you mean that the app can only be installed once per user and only on one device?

    0 comments No comments