1

I'm evaluating AWS Pinpoint to send push notifications.

In the reference document it states that ChannelType can be one of:

PUSH | GCM | APNS | APNS_SANDBOX | APNS_VOIP | APNS_VOIP_SANDBOX | ADM | SMS | VOICE | EMAIL | BAIDU | CUSTOM | IN_APP

However I was unable to find documentation on what happens when I use the value PUSH?

I have a sandbox iOS app set up, and if I register the endpoint as APNS_SANDBOX and send a message, it works. If I change to PUSH, register that, and send a message with channel type PUSH:

{
    "MessageConfiguration": {
        "DefaultPushNotificationMessage": {
            "Body": "Hello world",
            "Title": "Test title",
            "Action": "OPEN_APP",
            "SilentPush": false
        }
    },
    "Addresses": {
        "...token...": {
            "ChannelType": "PUSH"
        }
    }
}

I get the error response:

{
    "Message": "No Addresses or Endpoints to send to"
}

If I use the GET Endpoint API, I do see my endpoint registered there as a PUSH address:

{
    "ChannelType": "PUSH",
    "Address": "...token...",
    "EndpointStatus": "ACTIVE",
    "OptOut": "NONE",
    "RequestId": "...",
    "EffectiveDate": "2021-08-09T08:57:08.832Z",
    "ApplicationId": "...",
    "Id": "...",
    "CohortId": "51",
    "CreationDate": "2021-07-28T07:56:22.074Z"
}

I get the same error message if I register the endpoint as APNS_SANDBOX and use PUSH in SendMessage.

vekerdyb
  • 1,213
  • 12
  • 26

1 Answers1

0

There is nothing in the aws docs regarding PUSH channel you have to be specific, You can use the user.id something like this:

message_request = {
                "MessageConfiguration": {
                    "APNSMessage":
                    {
                        "Action": "OPEN_APP",
                        "RawContent":raw_message_ios

                    },
                    "GCMMessage": {
                        "Action": "OPEN_APP",
                        "RawContent":raw_message_android
                        #"{\"notification\": {\"title\": \"Hello Android World!\",\"body\":\"From PinPoint CLI\"},\"data\":{\"custom\":\"123 Penny Lane\"}}"
                    },
                },
                "Users": {
                    user:{
                        'TitleOverride': ""
                    }
                }
            }

I use this with send_users_messages

response = self.client.send_users_messages(
                    ApplicationId=self.application_id,
                    SendUsersMessageRequest=message_request
                )
  • Yeah, I'm able to send push notifications, but the docs _do_ mention PUSH as a possible channel type, and my question is about what happens when that is used? See [link](https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-messages.html#apps-application-id-messages-model-apnsmessage) under AddressConfiguration / ChannelType / Values: `PUSH | GCM | APNS | APNS_SANDBOX | ...` – vekerdyb Jun 27 '22 at 11:04