iOS 使用 APNs Auth Key 发送推送:突然“403 Forbidden: {“reason":“InvalidProviderToken"}" [英] iOS sending push with APNs Auth Key: suddenly "403 Forbidden: {"reason":"InvalidProviderToken"}"

查看:65
本文介绍了iOS 使用 APNs Auth Key 发送推送:突然“403 Forbidden: {“reason":“InvalidProviderToken"}"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在发送带有 APNs 身份验证密钥(永不过期")的推送通知,该密钥一直运行良好,直到我突然收到

I'm sending my push notifications with an APNs Auth Key ("never expires") which worked well until suddenly I get

403 Forbidden: {"reason":"InvalidProviderToken"}

作为发送推送通知时的响应.当它工作一次而突然没有到期日期时,这可能是什么原因?在此期间,它再次进行了一些推送,但现在我再次收到错误消息......还有其他人遇到过这种情况吗?

as a response when sending push notifications. What could be the reason for this when it worked once and suddenly it doesn't without having an expiration date? In the meantime it worked again for some pushes, but now I get the error again... Did anyone else experience this?

编辑

不确定,但似乎这只发生在 Ubuntu 服务器上,而不发生在我的本地 (OS X) 机器上......

推荐答案

我在几种情况下看到过这种情况:

I've seen this in a couple of circumstances:

  1. 重新提交过期的提供者令牌似乎将令牌列入黑名单,并导致随后的 InvalidProviderToken 拒绝,而不是 ExpiredProviderToken 拒绝.检查您的日志以获取令牌到期消息.检查您的系统时钟以确保您没有生成时间戳倾斜的令牌.

  1. Resubmitting expired provider tokens seems to get the token blacklisted and results in subsequent InvalidProviderToken rejections rather than ExpiredProviderToken rejections. Check you logs for token expiry messages. Check your system clock to make sure that you're not generating tokens with skewed timestamps.

提交无效主题将使连接上的所有提供者令牌无效(甚至以前有效的令牌).只提交密钥绑定的主题,并且每个连接只使用一个密钥.

Submitting to invalid topics will invalidate all provider tokens on the connection (even previously valid ones). Only submit to topics that the key is bound to and only use one key per connection.

这篇关于iOS 使用 APNs Auth Key 发送推送:突然“403 Forbidden: {“reason":“InvalidProviderToken"}"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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