PushSharp notifications to iOS are not reaching device

半世苍凉 提交于 2019-12-08 05:35:47

问题


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.

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

回答1:


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


来源:https://stackoverflow.com/questions/23116726/pushsharp-notifications-to-ios-are-not-reaching-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!