Search code examples
iosaws-pinpoint

Send push notification from iOS using AWS Pinpoint


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?


Solution

  • 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.