MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.23k stars 21.39k forks source link

"Got a SIGSEGV while executing native code." on iPhone 8 Plus device with iOS 13.1.1 #39834

Closed RazvanEmilR closed 4 years ago

RazvanEmilR commented 5 years ago

I apologize if the answer might be obvious but was this tested with iOS 13.1.1?

I followed the documentation and push notifications work perfectly on my iPhone 5S with iOS 12.4.2 but the same exact code give this error when testing on a iPhone 8 Plus with iOS 13.1.1:

(The crash occurs right after RegisteredForRemoteNotifications method is triggered)

Native Crash Reporting

================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.

================================================================= Native stacktrace:

0x1062909c8 - /private/var/containers/Bundle/Application/E913BEE0-4EE4-46CA-8E0F-D8A1B41C3C94/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : (null)
0x1062867b0 - /private/var/containers/Bundle/Application/E913BEE0-4EE4-46CA-8E0F-D8A1B41C3C94/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : (null)
0x106294ff0 - /private/var/containers/Bundle/Application/E913BEE0-4EE4-46CA-8E0F-D8A1B41C3C94/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : mono_pmip
0x1b9fb3894 - /usr/lib/system/libsystem_platform.dylib : <redacted>
0x1044e029c - /private/var/containers/Bundle/Application/E913BEE0-4EE4-46CA-8E0F-D8A1B41C3C94/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : (null)
0x1044e03fc - /private/var/containers/Bundle/Application/E913BEE0-4EE4-46CA-8E0F-D8A1B41C3C94/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : (null)
0x1044e7ff8 - /private/var/containers/Bundle/Application/E913BEE0-4EE4-46CA-8E0F-D8A1B41C3C94/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : (null)
0x1044e7b38 - /private/var/containers/Bundle/Application/E913BEE0-4EE4-46CA-8E0F-D8A1B4

1C3C94/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : (null) 0x1044e6364 - /private/var/containers/Bundle/Application/E913BEE0-4EE4-46CA-8E0F-D8A1B41C3C94/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : (null) 0x1044e5768 - /private/var/containers/Bundle/Application/E913BEE0-4EE4-46CA-8E0F-D8A1B41C3C94/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : (null) 0x1044e4620 - /private/var/containers/Bundle/Application/E913BEE0-4EE4-46CA-8E0F-D8A1B41C3C94/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : (null) 0x1ba68d0b0 - /System/Library/Frameworks/Foundation.framework/Foundation : 0x1b9fc11ec - /usr/lib/system/libsystem_pthread.dylib : _pthread_start 0x1b9fc4aec - /usr/lib/system/libsystem_pthread.dylib : thread_start

================================================================= Basic Fault Address Reporting

Memory around native instruction pointer (0x1b9fb2f44):0x1b9fb2f34 c0 03 5f d6 1f 20 03 d5 1f 20 03 d5 01 ec 7c 92 .._ .. ... ....|.

0x1b9fb2f44 20 00 c0 3d c3 f9 ff 10 62 04 c1 3c 02 0c 40 92 . .=....b..<..@. 0x1b9fb2f54 63 00 02 cb 61 00 c0 3d 00 1c a1 4e 05 00 00 14 c...a..=...N .... 0x1b9fb2f64 1f 20 03 d5 1f 20 03 d5 1f 20 03 d5 20 0c c1 3c . ... ... . . ..<

The method to register for push notifications(this is where the error occurs)

SIGSEGV_Error SIGSEGV_Error

:

public override void RegisteredForRemoteNotifications( UIApplication application, NSData deviceToken) { AzureNotifHub = new SBNotificationHub(AppConstants.AZURE_DEVNOTIFHUB3_LISTENSHARED, AppConstants.DEV_NOTIFHUB3);

        // update registration with Azure Notification Hub
        AzureNotifHub.UnregisterAllAsync(deviceToken, (error) =>
        {
            if (error != null)
            {
                Debug.WriteLine($"Unable to call unregister {error}");
                return;
            }

            var tags = new NSSet(AppConstants.IOSSUBSCRIPTIONTAGS.ToArray());
            AzureNotifHub.RegisterNativeAsync(deviceToken, tags, (errorCallback) =>
            {
                if (errorCallback != null)
                {
                    Debug.WriteLine($"RegisterNativeAsync error: {errorCallback}");
                }
            });

            var templateExpiration = DateTime.Now.AddDays(120).ToString(System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));
            AzureNotifHub.RegisterTemplateAsync(deviceToken, "defaultTemplate", AppConstants.IOS_APNS_TEMPLATE_BODY, templateExpiration, tags, (errorCallback) =>
            {
                if (errorCallback != null)
                {
                    if (errorCallback != null)
                    {
                        Debug.WriteLine($"RegisterTemplateAsync error: {errorCallback}");
                    }
                }
            });
        });
    }

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

RohitMungi-MSFT commented 5 years ago

@RazvanEmilR Could you please provide us the link to the documentation used before encountering the error? This will help us redirect the issue to the correct team.

RazvanEmilR commented 5 years ago

Hi Rohit,

The link to the documentation used is the following:

https://docs.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-ios-push-notification-apns-get-started

Sent from my iPhone

On Sep 30, 2019, at 11:39 PM, RohitMungi-MSFT notifications@github.com wrote:



@RazvanEmilRhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FRazvanEmilR&data=02%7C01%7C%7Ccc8fa292a7f744adfc5d08d7463a288d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637055087903679568&sdata=2sA%2FCrgoyFDaBwTKUwIXcoynI30RsVoGSXX7Jccjldc%3D&reserved=0 Could you please provide us the link to the documentation used before encountering the error? This will help us redirect the issue to the correct team.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fazure-docs%2Fissues%2F39834%3Femail_source%3Dnotifications%26email_token%3DAJPW2GBBUN22TPGPWDGPZGDQMLWDLA5CNFSM4I4EQ622YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAAE6PY%23issuecomment-536891199&data=02%7C01%7C%7Ccc8fa292a7f744adfc5d08d7463a288d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637055087903689573&sdata=D1BDi94SI5pfdQeo6kZhR2FNq6IruZhjtyWX6M4cVFM%3D&reserved=0, or mute the threadhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJPW2GAS4BT67CEIZMAHMV3QMLWDLANCNFSM4I4EQ62Q&data=02%7C01%7C%7Ccc8fa292a7f744adfc5d08d7463a288d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637055087903699584&sdata=muSUSbhwHLtYRge1rXzIM4uYscV14zGC202HCX0Vplg%3D&reserved=0.

BryanTrach-MSFT commented 4 years ago

@RazvanEmilR The doc has not been updated since May, which was a month before iOS 13 was publicly announced. We have assigned your feedback to the doc author to have them review the doc to see if there are any changes needed to the steps listed in order to ensure compatibility with iOS 13.

berlamont commented 4 years ago

We are running into the same thing

RazvanEmilR commented 4 years ago

@BryanTrach-MSFT Thanks for your answer. Hopefully its looked into soon.

@berlamont getting the same error with iOS 13? what type of device did you test this on.

berlamont commented 4 years ago

Actually i take it back, after updating to latest nuget, error is gone, thanks!

RazvanEmilR commented 4 years ago

@berlmaont, with iOS 13? Can you please provide a sample code with how you do registration for the hub in your case? Been spending days on this. The NuGet documentation provides a different code than in the documentation. Would help greatly if you could share a solution. Also maybe clarify what the exact connection string should look like. Also, can you confirm push notifications actually work, even though the error is gone as you say?

elierlopez commented 4 years ago

After following all steps and installing last stable version of required Nuget package I still face and issue

-RegisteredForRemoteNotifications is never executed (nor DidRegisterUserNotificationSettings)

and I found this message in the console :

2019-10-05 01:13:07.997 Ketser.iOS[2910:1598665] XPC connection interrupted 2019-10-05 01:13:08.871 Ketser.iOS[2910:1598661] Can't end BackgroundTask: no background task exists with identifier 2 (0x2), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug. Thread started: #7

-Also noticed that UnregisterAllAsync and RegisterNativeAsync don't not get the callback parameter any more.

am I missing something else out of the listed steps in this tutorial or may I suppose It 'll be updated soon ?

sethmanheim commented 4 years ago

@elierlopez Thank you for reporting this issue, I am currently investigating with the engineering team and will report back when I have more information.

elierlopez commented 4 years ago

Hey @sethmanheim thanks for answering.

It'll probably look weird but after making the RegisteredForRemoteNotifications method async, putting an await operator to Register and Unregister functions as shown in the attached image, adding a test tag "user" and waiting one day now it works and the device is able to display push notifications.

In previous days I received the below message every time I tried in notification hub resource in azure portal: Message was successfully sent, but there were no matching targets.

However I did not close the issue yet since I still think the documentation should be updated soon. Just in case a further investigation is done around this ticket; let me provide these additional details:

image

jwargo commented 4 years ago

Apple made some changes to APNS with iOS 13 and Xcode 11. We updated the SDK to accommodate a change in the way apps get the push token. A documentation update is going in today which describes this and other changes.

RazvanEmilR commented 4 years ago

@jwargo Registration with the hub currently works for me with this code(after updating Nuget package WindwosAzure.NotificationHubs.iOS to version 2.0.4):

Is this updated SDK going to change anything again? Or will still work as is?

try { AzureNotifHub = new SBNotificationHub(AppConstants.AZURE_DEVNOTIFHUB3_LISTENSHARED, AppConstants.DEV_NOTIFHUB3);

            // update registration with Azure Notification Hub
            await AzureNotifHub.UnregisterAllAsync(deviceToken);

            var tags = new NSSet(AppConstants.IOSSUBSCRIPTIONTAGS.ToArray());
            await AzureNotifHub.RegisterNativeAsync(deviceToken, tags);

            var templateExpiration = DateTime.Now.AddDays(120).ToString(System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));
            await AzureNotifHub.RegisterTemplateAsync(deviceToken, "defaultTemplate", AppConstants.IOS_APNS_TEMPLATE_BODY, templateExpiration, tags);
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex.Message);
        }
jwargo commented 4 years ago

@RazvanEmilR I'm sorry, I don't understand the question. We're making regular updates to the SDK.

tiagodenoronha commented 4 years ago

Getting this issue aswell. On UnregisterAllAsync, i'm getting the following error, even after updating the package to 2.0.4:

Native stacktrace:

0x106a9664c - /private/var/containers/Bundle/Application/3EF098DF-513C-4BC0-9731-DC825F3C60B8/Touch.app/Touch : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
0x106a8c434 - /private/var/containers/Bundle/Application/3EF098DF-513C-4BC0-9731-DC825F3C60B8/Touch.app/Touch : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
0x106a9ac74 - /private/var/containers/Bundle/Application/3EF098DF-513C-4BC0-9731-DC825F3C60B8/Touch.app/Touch : mono_pmip
0x1abfd3894 - /usr/lib/system/libsystem_platform.dylib : <redacted>
0x1029a4808 - /private/var/containers/Bundle/Application/3EF098DF-513C-4BC0-9731-DC825F3C60B8/Touch.app/Touch : (null)
0x1029a4968 - /private/var/containers/Bundle/Application/3EF098DF-513C-4BC0-9731-DC825F3C60B8/Touch.app/Touch : (null)
0x1029ac564 - /private/var/containers/Bundle/Application/3EF098DF-513C-4BC0-9731-DC825F3C60B8/Touch.app/Touch : (null)
0x1029ac0a4 - /private/var/containers/Bundle/Application/3EF098DF-513C-4BC0-9731-DC825F3C60B8/Touch.app/Touch : (null)
0x1029aa8d0 - /private/var/containers/Bundle/Application/3EF098DF-513C-4BC0-9731-DC825F3C60B8/Touch.app/Touch : (null)
0x1029a9cd4 - /private/var/containers/Bundle/Application/3EF098DF-513C-4BC0-9731-DC825F3C60B8/Touch.app/Touch : (null)
0x1029a8b8c - /private/var/containers/Bundle/Application/3EF098DF-513C-4BC0-9731-DC825F3C60B8/Touch.app/Touch : (null)
0x1ac6ad0b0 - /System/Library/Frameworks/Foundation.framework/Foundation : <redacted>
0x1abfe11ec - /usr/lib/system/libsystem_pthread.dylib : _pthread_start
0x1abfe4aec - /usr/lib/system/libsystem_pthread.dylib : thread_start

Basic Fault Address Reporting

Memory around native instruction pointer (0x1abfd2f44):0x1abfd2f34 c0 03 5f d6 1f 20 03 d5 1f 20 03 d5 01 ec 7c 92 .._.. ... ....|. 0x1abfd2f44 20 00 c0 3d c3 f9 ff 10 62 04 c1 3c 02 0c 40 92 ..=....b..<..@. 0x1abfd2f54 63 00 02 cb 61 00 c0 3d 00 1c a1 4e 05 00 00 14 c...a..=...N.... 0x1abfd2f64 1f 20 03 d5 1f 20 03 d5 1f 20 03 d5 20 0c c1 3c . ... ... .. ..<

Is there any information I can send to help debug?

ebelinski commented 4 years ago

I'm getting a similar crash. I'm on:

My code:

    public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) {
      AppLog.Checkpoint("Registered with APNs");
      AppLog.Checkpoint("Registering with Azure");

      // Connection string from your azure dashboard
      var cs = SBConnectionString.CreateListenAccess(
        new NSUrl(AppConstants.NOTIFICATION_HUB_ENDPOINT), AppConstants.NOTIFICATION_HUB_SECRET);

      string template = (Translate.Language == DeviceLanguage.Spanish) ? 
                    AppConstants.NOTIFICATION_IOS_TEMPLATE_SPANISH : 
                    AppConstants.NOTIFICATION_IOS_TEMPLATE_ENGLISH;

      // Register our info with Azure
      var hub = new SBNotificationHub(cs, AppConstants.NOTIFICATION_HUB_NAME);
      NSSet tags = new NSSet(ApplicationSettings.NotificationBucket);
      var expire = DateTime.Now.AddDays(90).ToString(CultureInfo.CreateSpecificCulture("en-US"));

      hub.RegisterTemplateAsync(deviceToken, "templateName", template, expire, tags, err => {
        if (err != null) {
          AppLog.Checkpoint("Error Registering with Azure: " + err.Description);
        }
        else {
          AppLog.Checkpoint("Successfully registered with Azure");
        }
      });
    }

Crash:

Launched application 'gov.stpaul.winterparking' on 'Eugene???s iPhone X' with pid 8662
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Mono.Security.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/System.Core.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/System.Numerics.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/System.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/System.Net.Http.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/System.Drawing.Common.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Xamarin.iOS.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/System.Xml.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Xamarin.Forms.Platform.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Xamarin.Forms.Core.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/System.ServiceModel.Internals.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/System.Runtime.Serialization.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Xamarin.Forms.Platform.iOS.dll [External]
Thread started:  #2
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Plugin.Permissions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Plugin.Geolocator.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Microsoft.WindowsAzure.Messaging.iOS.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Microsoft.AppCenter.iOS.Bindings.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Microsoft.AppCenter.Analytics.iOS.Bindings.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Microsoft.AppCenter.Crashes.iOS.Bindings.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SQLitePCLRaw.core.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SQLitePCLRaw.provider.sqlite3.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SQLitePCLRaw.batteries_v2.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SQLite-net.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/GalaSoft.MvvmLight.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Xamarin.Forms.Xaml.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/MonoTouch.Dialog-1.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/MonoTouch.NUnitLite.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/System.Data.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/System.Xml.Linq.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Newtonsoft.Json.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Microsoft.AppCenter.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking.exe
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Microsoft.AppCenter.Analytics.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/Microsoft.AppCenter.Crashes.dll [External]
2019-10-24 13:07:09.252 SaintPaulWinterParking[8662:5938104] Checkpoint: AppDelegate FinishedLaunching
2019-10-24 13:07:09.252 SaintPaulWinterParking[8662:5938104] Checkpoint: Initializing Xamarin Forms
2019-10-24 13:07:09.287 SaintPaulWinterParking[8662:5938104] Checkpoint: Filling IoC Container
2019-10-24 13:07:09.288 SaintPaulWinterParking[8662:5938104] Checkpoint: Loading Application
2019-10-24 13:07:09.314 SaintPaulWinterParking[8662:5938104] Checkpoint: SaintPaulWinterParking Constructor
2019-10-24 13:07:09.356 SaintPaulWinterParking[8662:5938104] Checkpoint: Checking T&C
2019-10-24 13:07:09.366 SaintPaulWinterParking[8662:5938104] Checkpoint: Loading MainPage
Thread started: <Thread Pool> #3
Thread started: <Thread Pool> #4
Thread started: <Thread Pool> #5
Thread started: <Thread Pool> #6
2019-10-24 13:07:09.600 SaintPaulWinterParking[8662:5938104] Checkpoint: Checking for UINotification
2019-10-24 13:07:09.600 SaintPaulWinterParking[8662:5938104] Checkpoint: SetupRemoteNotifications
[PLCrashReport] MSplcrash_log_writer_init:352: Could not retreive parent process name: Operation not permitted
2019-10-24 13:07:09.662 SaintPaulWinterParking[8662:5938104] [AppCenter] WARNING: -[MSAuthTokenContext authTokenHistory]/210 Failed to retrieve history state or none was found.
2019-10-24 13:07:09.662 SaintPaulWinterParking[8662:5938104] [AppCenter] WARNING: -[MSAuthTokenContext setAuthTokenHistory:]/225 Failed to save new history state.
2019-10-24 13:07:09.821 SaintPaulWinterParking[8662:5938104] Checkpoint: SaintPaulWinterParking Starting
2019-10-24 13:07:09.821 SaintPaulWinterParking[8662:5938104] Checkpoint: SaintPaulWinterParking Checking for Notifications
2019-10-24 13:07:09.823 SaintPaulWinterParking[8662:5938104] Checkpoint: IsConnected = true
Thread started:  #7
2019-10-24 13:07:09.956 SaintPaulWinterParking[8662:5938104] Checkpoint: Registered with APNs
2019-10-24 13:07:09.956 SaintPaulWinterParking[8662:5938104] Checkpoint: Registering with Azure

=================================================================
    Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
    Native stacktrace:
=================================================================
    0x101cd1a88 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101cc7870 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101cd6158 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : mono_pmip
    0x19e333894 - /usr/lib/system/libsystem_platform.dylib : <redacted>
    0x101c5593c - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101c55a9c - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101c5d688 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101c5dccc - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101c5dc3c - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101c5b7f4 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101c593b8 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101c584e8 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101766548 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x10175ac1c - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x1000f82d4 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x100497a54 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101cd9564 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : mono_pmip
    0x101d95fac - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : mono_pmip
    0x101d99848 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : mono_pmip
    0x10008fce8 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x10008f9e0 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x1a264f2f8 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
    0x19e2f1610 - /usr/lib/system/libdispatch.dylib : <redacted>
    0x19e2f2184 - /usr/lib/system/libdispatch.dylib : <redacted>
    0x19e2d535c - /usr/lib/system/libdispatch.dylib : <redacted>
    0x19e5a23c4 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
    0x19e59d3b8 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
    0x19e59c8bc - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific
    0x1a8408328 - /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal
    0x1a26326d4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain
    0x1014013d0 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x10135ae1c - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x10135ada4 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x1000f6d90 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x100497a54 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101cd9564 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : mono_pmip
    0x101d95fac - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : mono_pmip
    0x101d9c274 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : mono_pmip
    0x101cb7854 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x101ea3d94 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _Z9__isctypeim
    0x1000cc504 - /private/var/containers/Bundle/Application/BA298F53-5111-4B83-8019-44099B3DA913/SaintPaulWinterParking.app/SaintPaulWinterParking : _ZN7plcrash2MS5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy
    0x19e427460 - /usr/lib/system/libdyld.dylib : <redacted>

=================================================================
    Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x19e332f44):0x19e332f34  c0 03 5f d6 1f 20 03 d5 1f 20 03 d5 01 ec 7c 92  .._.. ... ....|.
0x19e332f44  20 00 c0 3d c3 f9 ff 10 62 04 c1 3c 02 0c 40 92   ..=....b..<..@.
0x19e332f54  63 00 02 cb 61 00 c0 3d 00 1c a1 4e 05 00 00 14  c...a..=...N....
0x19e332f64  1f 20 03 d5 1f 20 03 d5 1f 20 03 d5 20 0c c1 3c  . ... ... .. ..<

=================================================================
    Managed Stacktrace:
=================================================================
      at <unknown> <0xffffffff>
      at ApiDefinition.Messaging:void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr <0x00007>
      at WindowsAzure.Messaging.SBNotificationHub:RegisterTemplateAsync <0x0051b>
      at SaintPaulWinterParking.iOS.AppDelegate:RegisteredForRemoteNotifications <0x00593>
      at System.Object:runtime_invoke_dynamic <0x00103>
      at <unknown> <0xffffffff>
      at UIKit.UIApplication:UIApplicationMain <0x00007>
      at UIKit.UIApplication:Main <0x0002b>
      at UIKit.UIApplication:Main <0x00043>
      at SaintPaulWinterParking.iOS.Application:Main <0x0010f>
      at System.Object:runtime_invoke_dynamic <0x00103>
=================================================================
Thread started:  #8
Thread started:  #9
Thread started:  #10
Thread finished: <Thread Pool> #4
Thread finished: <Thread Pool> #5
Thread finished: <Thread Pool> #3
Thread started: <Thread Pool> #11
Thread finished: <Thread Pool> #6
Thread started: <Thread Pool> #12
Thread started: <Thread Pool> #13
Thread finished: <Thread Pool> #11
Thread started: <Thread Pool> #14
Thread finished: <Thread Pool> #13
Thread finished: <Thread Pool> #12
Thread started: <Thread Pool> #15
Thread started: <Thread Pool> #16
Thread finished: <Thread Pool> #14
Thread started: <Thread Pool> #17
Thread finished: <Thread Pool> #16
Thread finished: <Thread Pool> #15
Thread started: <Thread Pool> #18
Thread started: <Thread Pool> #19
Thread finished: <Thread Pool> #17
Thread started: <Thread Pool> #20
Thread finished: <Thread Pool> #19
Thread finished: <Thread Pool> #20
Thread started: <Thread Pool> #21
Thread finished: <Thread Pool> #18
Thread started: <Thread Pool> #22
Thread started: <Thread Pool> #23
Thread finished: <Thread Pool> #23
Thread finished: <Thread Pool> #22
Thread started: <Thread Pool> #24
Thread started: <Thread Pool> #25
Thread finished: <Thread Pool> #25
Thread finished: <Thread Pool> #21
Thread started: <Thread Pool> #26
ebelinski commented 4 years ago

I think this is an iOS 13.1 problem. When I had iOS 13.0, I tested this all and it worked fine.

ebelinski commented 4 years ago

Well I figured out my problem thanks partially to the suggestions here. First of all I removed the packages Microsoft.Azure.NotificationHubs and Microsoft.WindowsAzure.Messaging.iOS, and added Xamarin.Azure.NotificationHubs.iOS. I'm not sure why there are multiple packages covering iOS Azure NotificationHubs, but it seems like only Xamarin.Azure.NotificationHubs.iOS has the fix related to this crash in place, even though Microsoft.Azure.NotificationHubs is also updated regularly. Secondly I rewrote my method as:

    public async override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) {
      AppLog.Checkpoint("Registered with APNs");
      AppLog.Checkpoint("Registering with Azure");

      // Connection string from your azure dashboard
      var cs = SBConnectionString.CreateListenAccess(
        new NSUrl(AppConstants.NOTIFICATION_HUB_ENDPOINT), AppConstants.NOTIFICATION_HUB_SECRET);

      string template = (Translate.Language == DeviceLanguage.Spanish) ?
                    AppConstants.NOTIFICATION_IOS_TEMPLATE_SPANISH :
                    AppConstants.NOTIFICATION_IOS_TEMPLATE_ENGLISH;

      // Register our info with Azure
      var hub = new SBNotificationHub(cs, AppConstants.NOTIFICATION_HUB_NAME);
      NSSet tags = new NSSet(ApplicationSettings.NotificationBucket);
      var expire = DateTime.Now.AddDays(90).ToString(CultureInfo.CreateSpecificCulture("en-US"));

      try {
        await hub.RegisterTemplateAsync(deviceToken, "templateName", template, expire, tags);
        AppLog.Checkpoint("Successfully registered with Azure");
      }
      catch (Exception ex) {
        AppLog.Checkpoint("Error Registering with Azure: " + ex.Message);
      }
    }
sethmanheim commented 4 years ago

@RazvanEmilR Please reopen if you are still experiencing the problem. We have also published an article detailing some of the iOS 13 changes: https://docs.microsoft.com/en-us/azure/notification-hubs/push-notification-updates-ios-13. And finally, we are working our way through all of the Notification Hubs tutorials to make sure they are up to date.

sethmanheim commented 4 years ago

please-close

JanNepras commented 4 years ago

@sethmanheim Could you please verify that this documentation is updated? https://docs.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-ios-push-notification-apns-get-started