亚马逊SNS(推送通知)不会发送到IOS应用程序

最近应用程序无法收到通知,android方面工作正常,但ios一个失败

所以这里是我所尝试的:

1) generate token from apple apn service 2) create the endpoint at amazon backend 3) publish the message at amazon backend 4) it does not receive message and the endpoint will go to disabled after a while. 

我已经检查了以下内容:

 1) try serveal ios device , including iphone/ ipad/ipod touch also the same result 2) checked the secret key/ platform arn it is matched 3) created another platform ARN but still the same. 

那么,我应该继续debugging什么方向,例如推送通知证书? 我应该检查哪一部分编码,因为它以前工作,但最近才失败。

非常感谢。

如果SNS端点在一段时间后被禁用,则意味着您的APNS证书有问题。 你是否错误地使用了沙盒证书,或反之亦然? 你有正确的证书和私钥组合? 有关更多信息,请参阅http://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html

  1. 创build您的APN沙箱(开发)证书(确保您select了开发证书的包标识符)

  2. 创build沙盒证书后,validation您的预configurationconfiguration文件的推送通知服务已启用(不能使用APNS证书创build预configurationconfiguration文件,必须使用由开发证书创build的预configurationconfiguration文件)

  3. 如果您已经安装了开发configuration文件,则从以下path删除:“xcode-prefrences-select apple developer account – view details – provisiong profile”

  4. 从会员中心下载开发configuration文件并进行安装。 select新安装的configuration文件和证书

  5. login到Amazon SNS并select最近的位置(在右上angular),如下图所示,用红色的椭圆形。 更改位置的地方

  6. 在“移动服务”部分,selectSNS(推送通知服务)

  7. 现在您将进入SNS主屏幕,现在从菜单中select应用程序

  8. 点击“创build平台应用程序”。 input应用程序名称,然后select“推送通知平台”作为“Apple开发”,并将“推送证书types”作为“iOS推送证书”

  9. 现在你必须上传privateKey.p12

进程得到privateKey.p12

要获取privateKey.p12,请下载APNs(沙箱)证书并将其安装在krychain中。 然后打开钥匙串访问并展开证书,然后select开发者账户持有者的名字(它将具有钥匙和种类的图标作为“私钥”)。现在右键单击账户持有人名称并点击导出(如果你想要input密码,保留空白),然后名称为privatekey.p12并将其存储在桌面上

  1. 从桌面上selectprivateKey.p12,然后input密码,如果你已经设置,然后点击“从文件加载证书”然后证书和私钥字段将填充从privateKey.p12导出的值。

  2. 点击“创build应用程序平台”,你的新ios应用程序被创build。

  3. 点击ARN,它会进入你的应用程序。 现在点击“创build平台端点”

  4. 运行你的手机应用程序,并获得deviceToken

  5. 在“设备令牌”字段中input设备令牌,并在用户数据中给出设备名称。 现在点击“添加端点”

  6. select添加的端点,然后点击“发布到端点”

根据需要select信息格式,然后input您的信息,然后点击“发布信息”。