简体   繁体   English

自 Xamarin 应用程序的 iOS 13 起,推送通知不再有效

[英]Push Notifications no longer working since iOS 13 for Xamarin app

Since the public release of iOS 13 push notifications appear to no longer work for my Xamarin.Forms iOS project.由于 iOS 13 推送通知的公开发布似乎不再适用于我的 Xamarin.Forms Z1BDF605991920DB41 项目。 I currently use Azure Notification Hub to send test notifications and previously, my iPhones would get notifications with no problem.我目前使用 Azure 通知中心来发送测试通知,以前,我的 iPhone 可以毫无问题地收到通知。 Since iOS13 this is no longer happening.自 iOS13 以来,这不再发生。

I don't use OneSignal but they did post an article about the changes that were made for Push Notifications: https://onesignal.com/blog/ios-13-introduces-4-breaking-changes-to-notifications/我不使用 OneSignal,但他们确实发布了一篇关于推送通知所做更改的文章: https://onesignal.com/blog/ios-13-introduces-4-break-changes-to-notifications/

Is this problem still present?这个问题还存在吗? Or has anyone got any sources to confirm this issue other than SignalOne?或者除了 SignalOne 之外,还有没有人有任何消息来源来确认这个问题?

public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) {
    if (Hub == null) {
        Hub = new SBNotificationHub(ApiConstants.ListenConnectionString, ApiConstants.NotificationHubName);
    }

    // Following from the comments with FreakyAli, I have added these 3 lines
    Byte[] result = new byte[deviceToken.Length];
    Marshal.Copy(deviceToken.Bytes, result, 0, (Int32)deviceToken.Length);
    String token = BitConverter.ToString(result).Replace("-", "");

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

        NSSet tags = null;

        Hub.RegisterNativeAsync(deviceToken, tags, (errorCallback) => {
            if (errorCallback != null) {
                Debug.WriteLine($"RegisterNativeAsync error: {errorCallback}");
            }
        });
    });
}

The code above worked all the time but during debugging I have noticed it no longer steps into Hub.UnregisterAllAsync() and I believe it is causing some error?上面的代码一直有效,但在调试过程中我注意到它不再进入Hub.UnregisterAllAsync()并且我相信它会导致一些错误? (Can't make any sense of it though) (虽然无法理解)

=================================================================
    Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x1bffaaf44):
0x1bffaaf34  c0 03 
5f d6 1f 
20 03 d5 
1f 20 
03 d5 01 ec 
7c 92  
.._.. 
...
 ..
..|
.
0x1bffaaf44  20 00 c0 3d c3 f9 ff 10 
62 04 c1 3c 02 0c 40 92 
  ..=.
..
.b.
.<.
.@.

0x1bffaaf54  
63 00 02 
cb 61 00 
c0 3d 00 1c a1 4e 
05 00 
00 
14 
 c.
..
a.
.=.
.
.
N....
0x1bffaaf64  1f 20 03 d5 
1f 20 03 d5 1f 20 03 d5 20 0c 
c1 3c  . ..
. ... .. ..<

I have found these though - but I'm unsure how related these are to my current problem.虽然我已经找到了这些 - 但我不确定这些与我当前的问题有多大关系。 https://github.com/Azure/azure-notificationhubs-dotnet/issues/88 https://github.com/Azure/azure-notificationhubs-dotnet/issues/96 https://github.com/Azure/azure-notificationhubs-dotnet/issues/88 https://github.com/Azure/azure-notificationhubs-dotnet/issues/96

They recently changed their token, you need to make minor changes follow this link https://dev.to/codeprototype/correctly-capture-ios-13-device-token-in-xamarin-1968他们最近更改了他们的令牌,您需要按照此链接进行细微更改https://dev.to/codeprototype/correctly-capture-ios-13-device-token-in-xamarin-1968

I faced same issue, after updating nuget, delete bin & obj + rebuild, and using code in this article works for me --> Xamarin.iOS cannot register with Azure Notification Hub in iOS 13.1.2 I faced same issue, after updating nuget, delete bin & obj + rebuild, and using code in this article works for me --> Xamarin.iOS cannot register with Azure Notification Hub in iOS 13.1.2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Xamarin IOS上推送通知 - Push notifications on Xamarin IOS DidReceiveRemoteNotification 不在后台调用 - Xamarin iOS - 推送通知 - DidReceiveRemoteNotification is not called in background - Xamarin iOS - Push Notifications Xamarin.iOS Firebase 未收到推送通知但收到令牌 - Xamarin.iOS Firebase not receiving push notifications but receiving token 如何实现推送通知 firebase xamarin.ios c# - How implement Push Notifications firebase xamarin.ios c# Xamarin Forms在iOS平台上未收到Appcenter推送通知 - Appcenter push notifications not received by Xamarin Forms on iOS platform Xamarin Android 应用程序不再被 Firebase 正确验证,因为在其他手机上使用了电话号码 - Xamarin Android app is no longer being correctly verified by Firebase since using the phone # on a different phone 如何在 Xamarin.iOS 中使用 FCM(Firebase 云消息传递)发送 iOS 推送通知 - How to send iOS push notifications using FCM(Firebase cloud messaging) in Xamarin.iOS Xamarin iOS 13 中的基本共享 - Xamarin Essential Share in iOS 13 Xamarin Form(PCL)IOS Firebase推送消息不起作用 - Xamarin Form(PCL) IOS Firebase Push Message not working 证书的iOS推送通知AuthenticationException - iOS Push Notifications AuthenticationException for Certificate
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM