在Azure中向hub注册推送通知时,Xamarin.iOS本机崩溃错误SIGSEGV
我在我的Xamarin应用程序项目的iOS项目中使用此方法注册Azure for development中的通知中心(中心和应用程序配置为使用证书进行开发,并在apple developer portal上进行设置,在Authentications.plist中设置关键字为dev,中心上载了p12 dev证书) 在开发模式下,这种方法(以及应用程序)在我的iPhone 5S上运行得非常好 但在我的iPhone8 Plus上,我遇到了以下错误:在Azure中向hub注册推送通知时,Xamarin.iOS本机崩溃错误SIGSEGV,azure,xamarin.ios,apple-push-notifications,Azure,Xamarin.ios,Apple Push Notifications,我在我的Xamarin应用程序项目的iOS项目中使用此方法注册Azure for development中的通知中心(中心和应用程序配置为使用证书进行开发,并在apple developer portal上进行设置,在Authentications.plist中设置关键字为dev,中心上载了p12 dev证书) 在开发模式下,这种方法(以及应用程序)在我的iPhone 5S上运行得非常好 但在我的iPhone8 Plus上,我遇到了以下错误: ==========================
=================================================================
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:
=================================================================
0x103ef09c8 - /private/var/containers/Bundle/Application/10179C87-9D6C-4E2B-90AD-
57BF86C9C934/myapp.iOS.app/myapp.iOS : (null)
0x103ee67b0 - /private/var/containers/Bundle/Application/10179C87-9D6C-4E2B-90AD-
57BF86C9C934/myapp.iOS.app/myapp.iOS : (null)
0x103ef4ff0 - /private/var/containers/Bundle/Application/10179C87-9D6C-4E2B-90AD-
57BF86C9C934/myapp.iOS.app/myapp.iOS : mono_pmip
0x195cdf894 - /usr/lib/system/libsystem_platform.dylib : <redacted>
0x10214029c - /private/var/containers/Bundle/Applica
tion/10179C87-9D6C-4E2B-90AD-57BF86C9C934/ShakeAlarmRR1.iOS.app/ShakeAlarmRR1.iOS : (null)
0x1021403fc - /private/var/containers/Bundle/Application/10179C87-9D6C-4E2B-90AD-
57BF86C9C934/myapp.iOS.app/myapp.iOS : (null)
0x102147ff8 - /private/var/containers/Bundle/Application/10179C87-9D6C-4E2B-90AD-
57BF86C9C934/myapp.iOS.app/myapp.iOS : (null)
0x102147b38 - /private/var/containers/Bundle/Application/10179C87-9D6C-4E2B-90AD-
57BF86C9C934/myapp.iOS.app/myapp.iOS : (null)
0x102146364 - /private/var/containers/Bundle/Application/10179C87-9D6C-4E2B-90AD-
57BF86C9C934/myapp.iOS.app/myapp.iOS : (null)
0x102145768 - /private/var/containers/Bundle/Application/10179C87-9D6C-4E2B-90AD-
57BF86C9C934/myapp.iOS.app/myapp.iOS : (null)
0x102144620 - /private/var/containers/Bundle/Application/10179C87-9D6C-4E2B-90AD-
57BF86C9C934/myapp.iOS.app/myapp.iOS : (null)
0x1963b90b0 - /System/Library/Frameworks/Foundation.framework/Foundation : <redacted>
0x195ced1ec - /usr/lib/system/libsystem_pthread.dylib : _pthread_start
0x195cf0aec - /usr/lib/system/libsystem_pthread.dylib : thread_start
=================================================================
Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x195cdef44):0x195cdef34 c0 03 5f d6 1f 20 03 d5 1f 20 03
d5 01 ec 7c 92 .._.. ... ....|.
0x195cdef44 20 00 c0 3d c3 f9 ff 10 62 04 c1 3c 02 0c 40 92 ..
=....b..<..@.
0x195cdef54 63 00 02 cb 61 00 c0 3d 00 1c a1 4e 05 00 00 14 c...a..=...N....
0x195cdef64 1f 20 03 d5 1f 20 03 d5 1f 20 03 d5 20 0c c1 3c . ... ... .. ..<
我现在正在开发模式中使用iPhone8 Plus。此设备从app store下载了应用程序,因此之前已在生产模式下向通知中心注册,不知道这是否与此有关
此外,我使用的是一款测试版ios 13操作系统
什么可能导致此错误以及如何修复它?问题似乎是由于 当链接到iOS13/Catalina时,NSData.description已更改,因此如果您依赖它生成推令牌的字符串版本,您将遇到一些问题
拥有最新版本的NotificationHub软件包。如果在Xamarin版本的iOS软件包中没有解决这个问题,那么您必须在他们的Github上创建一个问题它是否仅在iOS 13中工作?@JackHua MSFT iPhone 8 Plus是我拥有的唯一支持iOS 13的测试设备,这是一个很好的观点。我只在我的iPhone5S测试设备上用12.4.1进行了测试,它可以正常工作。
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}");
}
}
});
});