iOS的PushSharp通知未到达设备 [英] PushSharp notifications to iOS are not reaching device

查看:144
本文介绍了iOS的PushSharp通知未到达设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am attempting to use the PushSharp library for apple push notifications in a c# service I am running.

所有代码似乎都可以正确执行,没有错误,并且似乎所有操作都正确完成.但是,通知永远不会到达我的应用程序.

The code all appears to execute correctly, there are no errors and it seems all things are done correctly. However the notification never reaches my application.

我读过的所有内容似乎都可以得出结论,问题出在我的证书上,但是我已经重新下载了该软件,并多次重做了步骤,一切似乎都是正确的.

Everything Ive read seems to conclude the issue is my certificate, but ive re-downloaded, and redone the steps numerous times and everything seems to be correct with it.

这是我的PushSharp C#代码

Here is my PushSharp c# code

            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));

推荐答案

从昨天开始,我也遇到了同样的问题.我只是尝试将SslProtocols从SslProtocols.Ssl3更改为SslProtocols.Default使它再次起作用.因此,Apple必须做出一些改变并拒绝Ssl3协议.

I got the same problem too since from yesterday. I just tried change the SslProtocols from SslProtocols.Ssl3 to SslProtocols.Default make it works again. So Apple must change something and refuse the Ssl3 protocol.

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

这篇关于iOS的PushSharp通知未到达设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆