【问题标题】:PushSharp notifications to iOS are not reaching device到 iOS 的 PushSharp 通知未到达设备
【发布时间】:2014-04-16 17:55:44
【问题描述】:

我正在尝试将 PushSharp 库用于我正在运行的 c# 服务中的苹果推送通知。

所有代码似乎都正确执行,没有错误,似乎所有事情都正确完成。但是通知永远不会到达我的应用程序。

我读过的所有内容似乎都认为问题出在我的证书上,但我重新下载并多次重做步骤,一切似乎都是正确的。

这是我的 PushSharp c# 代码

            string pushCertPath = string.Format(string.Format("{0}\\PushCert (DEV).p12", dataPath));
            var appleCert = File.ReadAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, pushCertPath));
            PushBroker push = new PushBroker();
            push.RegisterAppleService(new ApplePushChannelSettings(false, appleCert,"pushcert"));

           push.QueueNotification(new AppleNotification()
           .ForDeviceToken("594c78b070698ded0a5f3dc1503a42e3983b7c1d254b61a98cc6e5eb0e8b7edd")
           .WithAlert("You have received new messages")
           .WithSound("default")
           .WithBadge(1));

【问题讨论】:

    标签: c# ios push-notification pushsharp


    【解决方案1】:

    从昨天开始我也遇到了同样的问题。我刚刚尝试将 SslProtocols 从 SslProtocols.Ssl3 更改为 SslProtocols.Default 使其再次工作。所以苹果必须改变一些东西并拒绝 Ssl3 协议。

        stream.AuthenticateAsClient(settings.FeedbackHost, certificates, System.Security.Authentication.SslProtocols.**Default**, false);
    

    【讨论】:

    • 感谢 user3543150 对我几乎同时出现的问题发表评论!我实施了这里推荐的更改 stackoverflow.com/a/23121258/131717 。好像和你推荐的差不多。
    猜你喜欢
    • 2015-08-29
    • 1970-01-01
    • 2023-03-26
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    • 2021-12-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多