can you try sync version CreateOrUpdateInstallation - will it throw any exception?
Azure Notifcation Hub CreateOrUpdateInstallationAsync - Installation not being created - No Exception
I have an ASP.NET Web Api that is registering Android and iOS installations in our Azure Notification Hub. It creates a HubClient using a connection string
this.azureHub = NotificationHubClient.CreateClientFromConnectionString(
"Endpoint=sb://OUR-HUB-NS.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=tK/SEXXXXXXXXXXX/7LUtvRoNt+HjToFmP+T++yW5g=",
"OUR-HUB");
We then creating an installation using this code
try
{
await azureHub.CreateOrUpdateInstallationAsync(installation, cancellationToken);
}
catch(Exception e)
{
this.logger.LogError(e, "CreateOrUpdateInstallationAsync failed with" + e.Message);
return false;
}
return true;
That code does not throw an exception but from what I can tell the installation is not being created
- If I use the "Test Send" in Azure Portal I get "Message was successfully sent, but there were no matching targets." for either Apple or Android platform
- azureHub.GetAllRegistrationsAsync(0) returns an empty list
- azureHub.GetInstallationAsync(installation.InstallationId) fails becauise the installaiton is not available even if it try and get it in a retry loop
Any suggestions on how I diagnose what is happening to my installations?
3 answers
Sort by: Most helpful
-
-
SnehaAgrawal-MSFT 21,506 Reputation points
2022-01-13T15:58:42.827+00:00 Apologize for late response. Came across the query created by you on Stack Overflow. Thanks for sharing the solution that works for you.
Adding it here for community benefits: Azure Notifcation Hub CreateOrUpdateInstallationAsync not failing but Installation not being createdLet us know if you have further query on this.
-
Perera, Gayan 0 Reputation points
2023-09-26T01:16:32.0066667+00:00 Please ignore this.