As of version 2.0.4 (first update in a while), this documentation no longer matches code.
Documentation notes you should do Hub.RegisterNativeAsync(deviceToken, tags, (errorCallback)). Now, it only supports deviceToken and tags, no longer the third parameter.
I am assuming because the code was updated to handle await, but the examples do not show this.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for the feedback! We are currently investigating and will update you shortly.
Just use Hub.RegisterNative to use the third parameter (also UnregisterAll method is affected by this change!)
@sethmanheim can you please verify this?
Upon further review we feel your feedback would be best received by the doc author to determine if an update to the current doc is necessary if they align with the feedback.
@simonemarra this is actually what I did locally, just worry that 1) I am now missing any async call, but 2) the documentation as is wouldn't work right from this change.
@jmlumpkin Thank you for reporting this. I am investigating and will get back with a doc update ASAP.
@jmlumpkin Again, thank you. Some of the Notification Hubs tutorials are out of date due to Apple and Azure portal changes; we are working our way through them to make sure they are current.
You've closed this but the docs STILL haven't changed...
https://docs.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-ios-push-notification-apns-get-started#connect-your-app-to-the-notification-hub
`public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
{
Hub = new SBNotificationHub(Constants.ListenConnectionString, Constants.NotificationHubName);
Hub.UnregisterAll (deviceToken, (error) => {
if (error != null)
{
System.Diagnostics.Debug.WriteLine("Error calling Unregister: {0}", error.ToString());
return;
}
NSSet tags = null; // create tags if you want
Hub.RegisterNativeAsync(deviceToken, tags, (errorCallback) => {
if (errorCallback != null)
System.Diagnostics.Debug.WriteLine("RegisterNativeAsync error: " + errorCallback.ToString());
});
});
}`
Most helpful comment
You've closed this but the docs STILL haven't changed...
https://docs.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-ios-push-notification-apns-get-started#connect-your-app-to-the-notification-hub
`public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
{
Hub = new SBNotificationHub(Constants.ListenConnectionString, Constants.NotificationHubName);
}`