Replies: 3 comments 4 replies
-
looks like the wrong setup for the listener connection string and/or hub name to connect with azure notification hub |
Beta Was this translation helpful? Give feedback.
-
string connString = builder.Configuration["AzureNotificationHubs:ListenerConnectionString"]; builder.Services.AddPushAzureNotificationHubs(connString, hubName); I pulled them into strings to make it easer to put a breakpoint so I could inspect them. The conn string is copy/paste right out of the Azure portal UI if that helps. I'm assuming no transformation or reformatting is necessary, right? As a guide I started with the repo code examples and then used the templates and went through the builder and checked push and azure hubs. That is what I'm using as my main reference. |
Beta Was this translation helpful? Give feedback.
-
Never could figure out the problem. |
Beta Was this translation helpful? Give feedback.
-
I get an unauthorized exception when calling RequestAccess() on the IPushManager. I have
I am testing in the android emulator at API 33. The bundle name matches what is in firebase although, again, I think this is an issue with just getting to the azure hub. Maybe I have the wrong setup. I'm stuck. Any suggestions?
Thanks
{Microsoft.Azure.NotificationHubs.Messaging.UnauthorizedException: The remote server returned an error: (401) Unauthorized. Reason: Unauthorized..TrackingId:68517e3b-1f0f-4f6e-bb07-1d09e80b9288,TimeStamp:2023-09-17T20:30:45.4786608Z
at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendRequestAsync(HttpRequestMessage request, String trackingId, HttpStatusCode[] successfulResponseStatuses, CancellationToken cancellationToken)
at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendRequestAsync(HttpRequestMessage request, String trackingId, HttpStatusCode successfulResponseStatus, CancellationToken cancellationToken)
at Microsoft.Azure.NotificationHubs.NotificationHubClient.<>c__DisplayClass85_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.d__4
1[[System.Boolean, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.<RunOperation>d__4
1[[System.Boolean, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()at Microsoft.Azure.NotificationHubs.NotificationHubClient.CreateOrUpdateInstallationAsync(Installation installation, CancellationToken cancellationToken)
at Shiny.Push.AzureNotificationHubsPushProvider.Update(String nativeRegToken, CancellationToken cancelToken)
at Shiny.Push.AzureNotificationHubsPushProvider.Register(String nativeToken)
at Shiny.Push.PushManager.RequestAccess(CancellationToken cancelToken)
at Genovation.Mobile.Client.PushRegistration.CheckPermission(IPushManager push) in C:\Client\PushRegistration.cs:line 13}
Beta Was this translation helpful? Give feedback.
All reactions