Send push notification from iOS using AWS Pinpoint

2020-07-24 05:13发布

问题:

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?

回答1:

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.



回答2:

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