向 iOS 应用程序发送通知时出现 APNS 证书问题 [英] APNS Certificate Issue while sending notification to iOS App

查看:24
本文介绍了向 iOS 应用程序发送通知时出现 APNS 证书问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了向我的临时应用程序发送通知,我之前选择了分发 APNS 服务.我成功收到通知.

To send notifications to my adhoc app i selected previously Distribution APNS service. I got notifications successfully.

但是现在在创建证书时我很困惑在门户中选择哪个..

But now while creating certificate I’m in confusion which one to select in portal..

选择(沙盒和生产)并创建 .p12 文件并上传到我的服务器..但我收到以下错误您选择了生产服务器,但您的证书似乎不是生产证书!请检查以确保您拥有正确的证书!

Selected (sandbox&Prodcution) and created .p12 file and uploaded to my sever.. But Im getting following error You have selected the Production server, yet your Certificate does not appear to be the Production certificate! Please check to ensure you have the correct certificate!

我发现问题是由于 PushSharp,

I figured out the Issue is due to PushSharp,

https://github.com/Redth/PushSharp/issues/585#issue

但无法在该类中编辑/修改该代码.

But unable to edit/Modify that code in that class.

请帮帮我

谢谢...

推荐答案

在我的服务器端更改为以下代码后

After Changing to following code in my server side

pushBroker.RegisterAppleService(new ApplePushChannelSettings(true, appleCertificate, password));

pushBroker.RegisterAppleService(new ApplePushChannelSettings(true, appleCertificate, password));

pushBroker.RegisterAppleService(new ApplePushChannelSettings(true, appleCertificate, password, true));

pushBroker.RegisterAppleService(new ApplePushChannelSettings(true, appleCertificate, password, true));

更改:向构造函数添加了另外一个参数以禁用证书检查.

Changes: Added One more parameter to constructor to disable certificate check.

现在我收到新/旧证书的通知..

Now Im getting notifications for old/new certificates..

谢谢..

这篇关于向 iOS 应用程序发送通知时出现 APNS 证书问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆