I want to formulate a code to send the SMS to the client using AWS service i have written a code for message push and its also giving me 200 success response. But unable to get the way to send message to particular user.
public class Amazonsms {
AWS credentials -- replace with your credentials static String ACCESS_KEY = "AKIAIQOC7Y**********"; static String SECRET_KEY = "S2e4CwxUaZJZc***************";
Sender loop
public static void main(String... args) throws Exception {
// Create a client
AmazonSNSClient service = new AmazonSNSClient(new BasicAWSCredentials(ACCESS_KEY, SECRET_KEY));
// Create a topic
CreateTopicRequest createReq = new CreateTopicRequest()
.withName("MyTopic");
CreateTopicResult createRes = service.createTopic(createReq);
for (;;) {
// Publish to a topic
PublishRequest publishReq = new PublishRequest()
.withTopicArn(createRes.getTopicArn())
.withMessage("Example notification sent at " + new Date());
service.publish(publishReq);
Thread.sleep(1000);
}
}
}
Thanks in Advance.
