Cordova 推送通知不起作用

Cordova 推送通知不起作用,cordova,pushsharp,apn,Cordova,Pushsharp,Apn,我正在尝试使用pushsharp-nuget发送推送至IOS APN push.RegisterAppleService(new ApplePushChannelSettings(false, applecert, ""), serviceSettings); AppleNotification notif = new AppleNotification().ForDeviceToken(deviceToken)

我正在尝试使用
pushsharp-nuget
发送推送至IOS APN

push.RegisterAppleService(new ApplePushChannelSettings(false, applecert, ""), serviceSettings);
                    AppleNotification notif = new AppleNotification().ForDeviceToken(deviceToken)
                        .WithAlert(message)
                        .WithBadge(1)
                        .WithSound("default");
                    push.QueueNotification(notif);
                    //wait for queue to finish
                    push.StopAllServices(true);
它曾经奏效过。。。现在我不断得到这个例外:

您已经选择了开发/沙箱(不是生产)服务器,但 您的证书似乎不是开发/沙箱 证明书请检查以确保您拥有正确的证书


请帮帮我。

苹果已经改变了它们生成证书的方式,证书中的名称现在不同了,因此无法检查它是生产证书还是沙盒证书,这正是PushSharp过去所做的(除了验证它是这两种可能性之一)

要解决此Apple更改,无需更新PushSharp,您可以使用正确的构造函数禁用证书检查:

ApplePushChannelSettings(false,applecert,”,disableCertificateCheck:true)


最后,您应该查看PushSharp的3.x版本,因为这个问题在那里已经解决了,而且通常它是一个更稳定的版本。这也是HTTP/2 APNS提供商开发的地方。PushSharp 2.x很快就会被弃用。

这是证书…:) 我错误地导出了私钥而不是公钥。 现在它的发展模式和工程。 我将在这里更新生产模式的进展情况。
谢谢

您是在测试开发模式还是生产模式?您的代码似乎还可以。我打赌一定是你的证书出了问题。尝试使用密码重新生成它。我有两个证书(生产和开发),但我告诉Pushsharp这两个都是生产。沙盒有一些问题。。。