我是AWS的新手,正在尝试设置我的系统以便在预订后向终端用户发送确认短信。
到目前为止,我已经完成了以下步骤:
AmazonSimpleNotificationServiceClient smsClient = new AmazonSimpleNotificationServiceClient(key, secreteKey, token, Amazon.RegionEndpoint.APSoutheast2);
var smsAttributes = new Dictionary<string, MessageAttributeValue>();
MessageAttributeValue senderID = new MessageAttributeValue();
senderID.DataType = "String";
senderID.StringValue = "my-sender-id";
MessageAttributeValue sMSType = new MessageAttributeValue();
senderID.DataType = "String";
senderID.StringValue = "Transactional";
CancellationTokenSource source = new CancellationTokenSource();
CancellationToken token = source.Token;
smsAttributes.Add("SenderID", senderID);
smsAttributes.Add("SMSType", sMSType);
PublishRequest publishRequest = new PublishRequest();
publishRequest.Message = "This is 2nd sample message";
publishRequest.MessageAttributes = smsAttributes;
publishRequest.PhoneNumber = "my number with + and country code";
Task<PublishResponse> result = smsClient.PublishAsync(publishRequest, token);
然而我没有收到任何短信。
有人可以帮忙吗。