2

I am using AWS SDK to send push notifications to devices using direct messages. I was able to send message on Android using AmazonPinpointClient(creds).sendMessages(sendMessagesRequest).

I can find all equivalent classes on iOS except the AmazonPinpointClient.

What's the corresponding class to use on iOS?

Noura
  • 722
  • 10
  • 24
  • could you provide an example of how you specified the `messageRequest` object in the answer provided? I am stuck on the same issue and do not know how ot spec the messageRequest per this doc: https://aws-amplify.github.io/aws-sdk-ios/docs/reference/AWSPinpoint/Classes/AWSPinpointTargetingSendMessagesRequest.html#/c:objc(cs)AWSPinpointTargetingSendMessagesRequest(py)messageRequest – xiaolingxiao May 06 '20 at 16:21

2 Answers2

2

I found the class to send direct messages:

let sendMessagesRequest = AWSPinpointTargetingSendMessagesRequest()!
sendMessagesRequest.applicationId = appId
sendMessagesRequest.messageRequest = messageRequest

AWSPinpointTargeting.default().sendMessages(sendMessagesRequest){ response, error in 
        ...
}

Hope it saves someone's time.

Noura
  • 722
  • 10
  • 24
  • How did you specifify your messageRequest? Presumably it needs a device token, a title, and message body to start with right? – xiaolingxiao May 05 '20 at 20:17
-1

The AWS SDK you are using is not Pinpoint mobile SDK. (Probably you are using Pinpoint Java SDK)

There is no Android SDK or iOS SDK has sendMessages method.

Pinpoint Mobile SDK can only send events and update endpoint.

https://docs.aws.amazon.com/pinpoint/latest/developerguide/integrate-supported-sdks.html