Register an iOS device to the Azure Notification Hub

Enrico Rossini 176 Reputation points
2024-02-23T01:18:32.3+00:00

I'm creating an application with .NET8 MAUI and I like to add the push notification for all platforms. I have already added the push notification for Windows and Android but I'm stuck with iOS. In Windows, for example, I wrote this code

var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
channel.PushNotificationReceived += Channel_PushNotificationReceived;

var deviceInstallation = new
{
    InstallationId = new EasClientDeviceInformation().Id,
    Platform = "wns",
    PushChannel = channel.Uri
};

that gets the InstallationId and the PushChannel and with the deviceInstallation I can call the Azure Notification Hub via api to register the device. I can't find any example how to implement this part of code for iOS.

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.
270 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,960 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 18,946 Reputation points Microsoft Employee
    2024-02-26T06:42:43.7933333+00:00

    @Enrico Rossini Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    Based on the shared information, I understand that you are looking for a documentation on how to register an IOS device with notification hub using code.

    I would suggest you go through the samples present this azure-notificationhubs-ios SDk github repro and let me know if you any further questions on this.