IOS 应用程序 ARN 在 AWS SNS 中被禁用,即使 p12 文件在明年过期

IOS Application ARN Disabled in AWS SNS even p12 file has expire date in next year

我们在 Amazon AWS-SNS 下创建了很多应用程序来向苹果设备发送推送。 在创建每个应用程序时,我们都会上传 p12 文件,即使每个应用程序都有 p12 下一年的到期日期 我们的应用程序已过期(禁用),由于此推送不会发送到端点保存在同一个应用程序下。

谁能帮我看看导致应用程序 ARN 被禁用的各种原因是什么?提前谢谢你。

有时设备令牌会更改。然后,如果您尝试使用与无效令牌关联的端点,SNS 将禁用它。 即使您再次手动启用它,SNS 也会被告知此端点不再可用并将再次禁用它。

这可能对您有帮助:

Re-enabling an endpoint associated with an invalid token

When a mobile platform (such as APNS or GCM) informs SNS that the token used in the publish request was invalid, SNS disables the endpoint associated with that token. SNS will then reject subsequent publishes to that token. While it may be tempting to simply re-enable the endpoint and keep publishing, in most situations doing this has no beneficial effects: the messages published don’t get delivered and the endpoint becomes disabled again soon after.

The reason for this is that the token associated with the endpoint is genuinely invalid. Deliveries to it cannot succeed because it no longer corresponds to any installed app. The next time it is published to, the mobile platform will again inform SNS that the token is invalid, and SNS will again disable the endpoint.

To re-enable a disabled endpoint, it needs to be associated with a valid token (by using SetEndpointAttributes API call) and then enabled. Only then will deliveries to that endpoint become successful. The only time re-enabling an endpoint without updating its token will work is when a token associated with that endpoint used to be invalid but then became valid again. This can happen, for example, when an app was uninstalled and then re-installed on the same mobile device and received the same mobile token. The approach presented above does this, making sure to only re-enable an endpoint after verifying that the token associated with it is the most current one available.

您可以在这里阅读更多内容:Mobile token management with Amazon SNS

为避免 .p12 证书过期问题,您现在可以在 Amazon SNS 中为 APNS 使用 .p8 令牌。看看这个:https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-sns-token-authentication-api-mobile-notifications/