MrRhoads
MrRhoads

Reputation: 183

Amazon Pinpoint Message Not Delivered In IOS

I have been trying to use Amazon Pinpoint to run push notification campaign for iOS using the sample app to no avail. For Android, it was successful though. I tried pushing using APNS directly and Amazon SNS, both were successful.

I am suspecting that there are some certification issues relating to iOS. I used this documentation guide to obtain the .p12 certificate to upload to 'Manage - Channel' section of the Pinpoint interface and also for Amazon SNS.

http://docs.aws.amazon.com/mobile-hub/latest/developerguide/ios-appid-setup.html

The devices were detected but the messages weren't delivered to iOS. In the screenshot below, the delivered count is for Android device (2 iOS device, 1 Android). enter image description here

Any help will be greatly appreciated. Thanks!!

Upvotes: 0

Views: 1708

Answers (1)

Cheruvian
Cheruvian

Reputation: 5867

Could this be because your cert is a "dev" or "APNS Sandbox" cert?

If so, sending to APNS Sandbox is not currently supported via the Amazon Pinpoint Console.

To do so using the CLI (or any SDK) is relatively straightforward but requires some shell knowledge.

You'll first want to register your APNS_SANDBOX channel

## Assuming you have your cert and key in the following files
MY_CERT=$(cat my-cert.ct)
MY_KEY=$(cat my-key.pk)
aws pinpoint update-apns-sandbox-channel --apns-sandbox-channel-request  Certificate=$MY_CERT,Enabled=true,PrivateKey=$MY_KEY

Then you can send to any address directly using the direct send API

aws pinpoint send-messages --message-request "{
    \"Addresses\": {
        \"YOUR_SANDBOX_TOKEN_HERE\": {
            \"ChannelType\": \"APNS_SANDBOX\"
        }
    },
    \"MessageConfiguration\": {
        \"APNSMessage\": {
            \"Action\": \"OPEN_APP\",
            \"Body\": \"Body of message\",
            \"Title\": \"Subject\"
        }
    }
}"

Upvotes: 2

Related Questions