Powiadomienie jabłko pushsharp Wywołanie błędu SSPI nie powiodło się
Używam PushSharp do wysyłania powiadomień Apple Push w C #, mam swój produkcyjny plik .pem i jego hasło. Poniżej znajduje się mój fragment kodu. Zawsze otrzymuję ten błąd ..
"A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The message received was unexpected or badly formatted-"
LUB
"System.IO.IOException: Authentication failed because the remote party has closed the transport stream."
Próbowałem prawie wszystkich kodów dostępnych w net.Even wypróbowałem MoonAPNS, ale ten sam błąd, Dla skryptu niestandardowego otrzymuję także ten błąd SSPI. Używam tego samego pliku .pem i uruchamiam skrypt php, aby wysłać powiadomienie push do APN z tego samego serwera, działa.
var push = new PushBroker();
var appleCert = File.ReadAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ck.pem"));
push.RegisterAppleService(new ApplePushChannelSettings(false, appleCert, "pwd"));
push.QueueNotification(new AppleNotification()
.ForDeviceToken("XXXXXXXXXXXXXXX")
.WithAlert("Hello World!")
.WithBadge(7)
.WithSound("sound.caf"));
LogManager.Info("Waiting for Queue to Finish..");
push.StopAllServices();
Z góry dziękuję