Azure / azure-notificationhubs-dotnet

.NET SDK for Azure Notification Hubs
MIT License
70 stars 122 forks source link

Cleanup management apis branch #123

Closed varvusc closed 4 years ago

ederbond commented 4 years ago

Hey @stankovski, @varvusc, @wesmc7777, @mpodwysocki , Do you guys knows how should I serialize the iOS device token on my iOS project to send it to my asp.net core backend webapi that will create an installation for Azure Notification Hub on the backend?

I'm trying to do it this way,

public override async void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        {
            if ( deviceToken == null) return;

            var deviceInstallation = new DeviceInstallation
            {
                InstallationId = installationId.Value.ToString(),
                Handle = deviceToken.GetBase64EncodedString(NSDataBase64EncodingOptions.None),
                Platform = NotificationPlatform.Apns
            };

            //... Here I post the deviceInstallation object created above to my backend using an HttpClient....
        }

However I'm receiving an error from the NotificationHubClient on the backend asp.net core api whe I try to call _hub.CreateOrUpdateInstallationAsync(installation);

stankovski commented 4 years ago

@ederbond can you file an issue with this question?