Azure Notification Device Registration is not working

Reddy, Santosh 0 Reputation points
2023-04-26T17:51:28.9633333+00:00

We have create api where we have return logic to register device using await CreateOrUpdateInstallationAsync(installationid, cancellation-token), this method run successfully and does not throw any error, but device is not getting registered. The same logic was working fine previously, but suddenly this start happening. Not sure, what is the issue.

When we call GetInstallationAsync(installationid) with the same installation id used during CreateOrUpdateInstallationAsync() it throw below error,

Installation not found.TrackingId:dbe5e017-e7d4-4d3d-bdde-b659d636cdd6_G7,TimeStamp:4/26/2023 5:50:35 PM

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.
301 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 20,856 Reputation points
    2023-04-27T17:42:10.96+00:00

    @Reddy, Santosh Thanks for reaching here!

    • If the CreateOrUpdateInstallationAsync method is not throwing any errors and is returning a successful status code, it is possible that the installation is not being created due to some other issue.
    • One possible reason could be that the connection string used to connect to the notification hub is incorrect or has expired. You can check if the connection string is correct and has not expired by creating a new connection string and using it to connect to the notification hub.
    • Another possible reason could be that the installation ID is not being generated correctly. You can try generating a new installation ID and see if that resolves the issue.
    • Also Using installations enables you to do partial registration updates. The partial update of an installation is requested with a PATCH method using the JSON-Patch standard.
    • To highlight when using CreateOrUpdateInstallationAsync(), though the name has 'update' in it, NotificationHub documentation advises us to use PatchInstallationAsync() with patch-update process. PatchInstallationAsync()
    • If the issue persists, you can try using the Notification Hubs REST API to create and manage installations.

    Reference: https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-push-notification-registration-management

    Let us know if further query or issue remains.

    0 comments No comments