获取"EndpointDisabled"从Amazon SNS [英] Getting "EndpointDisabled" from Amazon SNS

查看:213
本文介绍了获取"EndpointDisabled"从Amazon SNS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Amazon SNS.通知效果很好,但有时会出现此错误:

{
    "message": "Endpoint is disabled",
    "code": "EndpointDisabled",
    "name": "EndpointDisabled",
    "statusCode": 400,
    "retryable": false
}

也许你知道为什么.

解决方案

您可以创建一个新的SNS主题(例如push-notification-failures),然后将其APNS/APNS_SANDBOX应用程序的传递失败"事件与之关联.通过电子邮件订阅事件(并确认),您将获得有关失败的有用的调试信息.这一切都可以通过SNS控制台完成,不需要执行API调用.

值得HTTP端点订阅此SNS主题并记录所有传递失败,这样您就可以使用历史数据来解决生产问题并进行调试了.

例如,传递与端点关联的平台令牌无效"的FailureMessage表示您正在从APNS_SANDBOX向APNS注册的设备发送消息,反之亦然.这可能意味着您的构建系统的APNS设置错误. (我们有一个令人沮丧的问题,那就是使用APNS_SANDBOX开发的二进制文件与使用APNS进行本地测试和质量检查的TestFlight二进制文件的令人沮丧的问题,这就是导致我走这条路的原因.)

I'm using Amazon SNS. Notifications work well, but sometimes I get this error:

{
    "message": "Endpoint is disabled",
    "code": "EndpointDisabled",
    "name": "EndpointDisabled",
    "statusCode": 400,
    "retryable": false
}

Maybe you know why.

解决方案

You can create a new SNS topic such as push-notification-failures and then associate your APNS/APNS_SANDBOX applications' "Delivery Failures" event to it. Subscribe to the event via email (and confirm) and you'll get useful debugging information about failures. This can all be accomplished through the SNS console and doesn't require API calls to perform.

It is probably worth it to subscribe an HTTP endpoint to this SNS topic and record all delivery failures so you have historical data to work from and debug production issues.

For example a delivery FailureMessage of "Platform token associated with the endpoint is not valid" means that you're sending a message from APNS_SANDBOX to an APNS registered device or vice versa. This can mean that you have the wrong APNS settings for your build system. (We have a frustrating problem of developer built binaries using APNS_SANDBOX vs. TestFlight built binaries using APNS for local testing and QA which is what led me down this path.)

这篇关于获取"EndpointDisabled"从Amazon SNS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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