我正在使用PushSharp在我的應用程序中發送推送通知。它爲Android工作正常。失敗:PushSharp.Apple.ApplePushService - >拋出類型'PushSharp.Apple.NotificationFailureException'的異常
對於蘋果iOS - 它不起作用,我們正在使用帶密碼的開發證書文件。 最初我們使用了錯誤的密碼,然後我們發現問題並修復。
它越來越波紋管的錯誤消息
Channel Created for: PushSharp.Apple.ApplePushService Failure: PushSharp.Apple.ApplePushService -> Exception of type 'PushSharp.Apple.
NotificationFailureException' was thrown. -> {"aps":{"alert":"Hello World!","badge":7,"sound":"default"}}
錯誤狀態碼:8
錯誤說明:無效的令牌
軟件,即可通過我們的供應商之一開發和推送通知我們從我們這邊做。 供應商使用一些正在工作的PHP代碼發送推送通知。 要推動他們使用PHP服務器Laravel框架和庫通知:https://github.com/davibennun/laravel-push-notification
我已經安裝了該應用程序我的iPhone設備上,他們發送測試推送通知它的正常工作。
但我試圖發送使用Pushsharp框架它不工作。
他們說開發證書文件是正確的,它工作正常。
我已經嘗試了所有可能的選項從我的最後,但我沒有得到任何線索爲什麼它的行爲奇怪與開發證書.p12。請幫我解決這個問題。我們用於發展
代碼:
var push = new PushBroker();
var appleCert = File.ReadAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "xxxxPass.p12"));
push.RegisterAppleService(new ApplePushChannelSettings(appleCert, "xxxx12345")); //Extension method
push.QueueNotification(new AppleNotification()
.ForDeviceToken("a51b4e80d12df0946d10413991ce1f7ab57c05bab8a292fc703ded34ce77b91f")
.WithAlert("Hello World!")
.WithSound("default")
.WithBadge(7));