Search code examples
amazon-web-servicesapple-push-notificationsaws-sdkamazon-sns

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


We have lot of applications created under Amazon AWS-SNS to send a push to apple devices. While creating each app we are uploading p12 files, even every application's has p12 expiry date in the next year our applications getting expired(disabled), Due to this push is not going to endpoints which are saved under the same application.

Could any one please help me that what are the various reasons which caused Application ARN disabled? Thank you in advance.


Solution

  • sometimes the device token changes. Then, if you're trying to use an endpoint associated with a invalid token, SNS will disable it. Even if you enable it again manually, SNS will be informed that this endpoint is no longer available and will disable it again.

    This may help you:

    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.

    You can read more here: Mobile token management with Amazon SNS