I am using Amazon SNS Mobile Push Notifications for Android and ios. I pretty successfully sent a push notification with just the text and icon. Now I'm trying to send a notification from the bottom of the image. I searched everything, but could not find the ideal documents for the job. Any suggestions please.
I installed this package using npm, I used this to send push notifications. please refer to this link. https://www.npmjs.com/package/sns-mobile
AWS_SNS_App.getUsers(function (err, allDevices) { if (err) { console.log(err, err.stack); // an error occurred } else { if (allDevices.length != 0) { var totalDevices = 0; for (var i = 0; i < allDevices.length; i++) { totalDevices = totalDevices + 1; AWS_SNS_App.sendMessage(allDevices[i].EndpointArn, message, function (err, messageId) { if (err) { console.log('An error occured sending message to device %s'); res.send(err); } else { //res.send('Successfully sent a message to device , MessageID was : ' + messageId); } }); } if (totalDevices === allDevices.length) { res.send('Successfully sent a message to all devices'); } } } });
sendMessage (endpointArn, message, callback) Send a message to the user. The message parameter can be a string or an object with the formats below. The callback format is a callback (err, messageId).
from the documents indicates the endpointArn message is sent, and we will receive a callback to any response. that I can send the image along with the image is possible or in any other way to do this.
thanks.
Sukumar ms
source share