Pretty simple code works fine in iOS, but when working with the new previews for iOS 13, I get pretty hard crashes SIGSEGV with the following code:
Hub.UnregisterAllAsync(deviceToken, (error) =>
{
if (error != null)
{
System.Diagnostics.Debug.WriteLine("Error calling Unregister: {0}", error.ToString());
return;
}
string[] tags_array = AppDelegate.notificationTags.ToArray(); NSSet tags = new NSSet(tags_array); Console.WriteLine($"tags after unmount: {tags}"); Hub.RegisterNativeAsync(deviceToken, tags, (errorCallback) => { if (errorCallback != null) System.Diagnostics.Debug.WriteLine("RegisterNativeAsync error: " + errorCallback); }); });
There is no update for Xamarin.Azure.NotificationHubs.iOS in the last couple of years. It only seems to affect iOS 13.
It looks like it hits SBNotificationHubHelper signString:withKeyData:keyLength, then crashes into native code. No breakpoints are hit
Somebody did the fix for iOS native lib, if somebody could just convert to C# and update the Xamarin Azure Notification Hub iOS package, it would be awesome.
@JamesMontemagno Don't you have somebody on your team that can fix this, seems like a fairly small thing to be honest.
https://github.com/xamarin/XamarinComponents/issues/676#issuecomment-536899918
It might be time anyway, as this nuget haven't been updated since 2016!
https://www.nuget.org/packages/Xamarin.Azure.NotificationHubs.iOS/1.2.5.2
FYI @jmlumpkin
Answers
I will follow along here too, as iOS 13 is really out now, as are XCode 11, i start hitting this yesterday too.
Right at the point my app reach this Hub.UnregisterAllAsync (Also the other versions of this method) it just hard crash, no breakpoint are hit en the error method.
Very annoying!
@jmlumpkin Did you find a solution?
Seems like it might be due to the fact that iOS 13 change the format/structure for the token:
https://nshipster.com/apns-device-tokens/
@jmlumpkin I saw you also posted here: https://stackoverflow.com/questions/57929568/app-crashes-hard-in-unregisterallasync-when-trying-to-run-in-ios-13-in-xamarin-i
Somebody did the fix for iOS native lib, if somebody could just convert to C# and update the Xamarin Azure Notification Hub iOS package, it would be awesome.
@JamesMontemagno Don't you have somebody on your team that can fix this, seems like a fairly small thing to be honest.
https://github.com/xamarin/XamarinComponents/issues/676#issuecomment-536899918
It might be time anyway, as this nuget haven't been updated since 2016!
https://www.nuget.org/packages/Xamarin.Azure.NotificationHubs.iOS/1.2.5.2
FYI @jmlumpkin
Thank you for keeping up on this. I got buried on this just due to trying to get a bunch of minor updates to our app for launch day on iOS 13.
I do wish there was a way to be more proactive with the dev cycles. In several places asking questions, it seemed like it was almost unheard of to use pre-release to be prepared for iOS launch day.
I ended up doing a null check before Hub.UnregisterAllAsync which actually fixed our issue (wasn't in code prior). We need to review our code quite a bit because it is not reliably working.