PushSharp返回新创建的P12的无效令牌

PushSharp返回新创建的P12的无效令牌

本文介绍了PushSharp返回新创建的P12的无效令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到苹果公司的一封电子邮件,说我的推送通知证书即将到期,因此,为了积极主动,我重新生成了证书并导出了P12,但是现在当我使用新的P12而不是旧的PushSharp时,会导出该P12我出现无效令牌"错误.如果那样的话,我使用旧的P12,则通知会成功发送.

I have had an email from Apple saying that my push notifications certificate is due to expire, so trying to be proactive I have regenerated the certificate and exported the P12 however now when I use that new P12 instead of the old one PushSharp gives me an "Invalid Token" error. If then I use the old P12, the notification is sent successfully.

我现在试图撤销旧证书,因为我的理论是应用程序仍在使用旧证书来生成设备令牌,但是旧的P12仍然有效,而新的P12无效.

I have now tried to revoke the old certificate as my theory was that the old certificate was still being used by the application to generate the device's token, however the old P12 still works, the new one doesn't.

在新证书生效之前,我是否需要等待旧证书完全过期?

Do I have to wait for the old certificate to fully expire before the new one will work?

Push Sharp还会引发什么其他原因?

What other reason could there be for Push Sharp to raise an "Invalid Token" exception?

所有这些都是针对为PushSharp设置了Production ApnsServerEnvironment的TestFlight(Adhoc)版本的.

All this is against a TestFlight (Adhoc) version with the Production ApnsServerEnvironment set for PushSharp.

推荐答案

经过进一步调查,我发现P12导出需要针对证书而不是私钥进行.

After further investigation, I have found that the P12 export needs to occur against the certificate and not the private key.

我似乎对这里的说明误导了 https://developer.xamarin.com/guides/ios/application_fundamentals/notifications/remote_notifications_in_ios/

I seem to have been mislead by the instructions here https://developer.xamarin.com/guides/ios/application_fundamentals/notifications/remote_notifications_in_ios/

导出证书-展开证书,以便可见关联的私钥,右键单击该密钥,然后选择导出".将提示您输入导出文件的文件名和密码.

这篇关于PushSharp返回新创建的P12的无效令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 14:14