Xmarin.IOS Remote Notification Stop Working

Abed Hamodi 1 Reputation point
2021-08-11T13:18:52.263+00:00

the remote notification stop working after after March 31, 2021.
after we receive the below message the notification stop working Please see it :

The HTTP/2‑based Apple Push Notification service (APNs) provider API lets you take advantage of great features, such as authentication with a JSON Web Token, improved error messaging, and per‑notification feedback. If you still send push notifications with the legacy binary protocol, make sure to upgrade to the APNs provider API as soon as possible. APNs will no longer support the legacy binary protocol after March 31, 2021.


We send push notifications to Xamarin.iOS apps using Azure Notification Hubs ,
After a lot of checking we found some code become not work correct when use Hub.UnregisterAllAsync the call back not worked
Please see the code we need your help.
Thanks

  public override void **RegisteredForRemoteNotifications** (UIApplication application, NSData deviceToken)
    {
        Hub = new SBNotificationHub (ApplicationParameter.NotificationConnectionString, ApplicationParameter.NotificationHubPath);
        Hub.UnregisterAllAsync (deviceToken, (error) => {

            **if (error != null) return;
            var tags = new List<string> { ApplicationHelper.GetTag () };
            Hub.RegisterNativeAsync (deviceToken, new NSSet (tags.ToArray ()), (errorCallback) => {
                if (errorCallback != null) Console.WriteLine ("RegisterNativeAsync error: " + errorCallback.ToString ());
            });**
        });

    }
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.
265 questions
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,297 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kyle Wang 5,531 Reputation points
    2021-08-12T06:36:34.183+00:00

    @Abed Hamodi Seems to be an issue caused by the Apple's update. Maybe you can refer to the link provided in Reminder: APNs provider API requirement starts March 31 to upgrade to the APNs provider API or ask a question on Apple Developer Forums.

    0 comments No comments