I have figured out how to send one basic message to a list of users with sendUsersMessages. However, I can't figure out how to customize the message for each user with substitutions. Also, should I use sendMessages or sendUsersMessages if I am sending unique messages for each user?
The documentation is here, but is hard to understand. All the examples found online seem to just send one push notification.
How can I convert the following to sending different users customized push notifications?
const gcmRawContent = JSON.stringify({
data: {
title,
message: pushText,
experienceId,
channelId,
body,
},
});
const messageConfiguration = {
MessageConfiguration: {
GCMMessage: {
RawContent: gcmRawContent,
},
},
};
const sendMessagesParams = {
ApplicationId,
SendUsersMessageRequest: {
Users: { 'userId1': {}, 'userId2': {} },
...messageConfiguration,
},
};
const pinpoint = new AWS.Pinpoint();
await pinpoint.sendUsersMessages(batchSendMessagesParams).promise();