Impossible to register android device in Azure Notification Hub
0
I am trying to update my platform (mobile app in xamarin forms and backend in .net7) to set notifications on android devices via the google Fcmv1 system. Unfortunately I can't register the device on my Azure Notification Hub. I tried the various codes that I found on the official documentation but without success. My app sends token to backend and backend tries registration on hub. I don't get any error but anyway I don't find device on hub.
I tried
var nhClient = NotificationHubClient.CreateClientFromConnectionString(ConnectionString, HubName);
var installation = new Installation
{
InstallationId = $"{device.ID}",
Platform = NotificationPlatform.FcmV1,
PushChannel = device.Token,
PushChannelExpired = false,
UserId = $"{device.ID}"
};
await nhClient.CreateOrUpdateInstallationAsync(installation);
and also
var nhClient = NotificationHubClient.CreateClientFromConnectionString(ConnectionString, HubName);
var tags = new HashSet<string> { "tag1", "tag2" };
FcmV1RegistrationDescription registration = await nhClient.CreateFcmV1NativeRegistrationAsync(deviceToken, tags);
and also
var nhClient = NotificationHubClient.CreateClientFromConnectionString(ConnectionString, HubName);
var installation = new FcmV1Installation($"{device.ID}", device.Token);
await nhClient.CreateOrUpdateInstallationAsync(installation);
The hub works correctly for both iOS and android with the old GCM system that now no longer working but the device registration occurs correctly using this code
var installation = new Installation
{
InstallationId = $"{device.ID}",
Platform = NotificationPlatform.Fcm,
PushChannel = device.Token,
PushChannelExpired = false,
UserId = $"{device.ID}"
};
I'm really frustrated about this problem. Any idea? Thanks
I tried code found here: https://learn.microsoft.com/en-us/answers/questions/1533052/where-i-can-download-new-version-of-microsoft-azur and other code found on web (pretty much the same of official doc)
I expect to find registered device on hub