问题
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