Getting “EndpointDisabled” from Amazon SNS

前端 未结 9 1044
深忆病人
深忆病人 2020-12-23 11:34

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

{
    \"message\": \"Endpoint is disabled\",
    \"code\": \"EndpointDisabled         


        
9条回答
  •  一整个雨季
    2020-12-23 11:55

    Quick checklist before taking drastic measures:

    1. Generate the Certificate Signing Request (CSR) using Keychain App.
    2. Export the APNS certificate and its private key into a single p12 file using Keychain App.
    3. When you create a new application in Amazon SNS, the platform must match the APNS environment (Development/Production on both sides).
    4. When you request a device token, you must be in the right application (the application's bundle identifier matches the APNS certificate).
    5. When you create a new platform endpoint in AWS SNS, the device token must be added to the right application (the good application certificate and the good Development/Production platform).

    In my case I generated the CSR using a third party SSL tool. I obtained a valid certificate from Apple developer portal but without the private key. Then I tried Windows' certificate tool to export without great success. Waste of time. Start your Mac.

    Then I used the AmazonMobilePush sample app to get a device token. Because the demo's bundle identifier doesn't match my certificate, the endpoint was invalid. At each SNS sending the endpoint became disabled (false). At the end the cause was obvious, but I still lose precious time.

提交回复
热议问题