Я хочу отправить смс пользователю через Amazon SNS. Я написал следующий код в vb.net, но произошла ошибка:
"Атрибут сообщения 'AWS.SNS.SMS.SMSType' имеет недопустимый тип атрибута сообщения, набор поддерживаемых префиксов типов - Binary, Number и String."
Мой код события нажатия кнопки:
Imports Amazon.SimpleNotificationService
Imports Amazon.SimpleNotificationService.Model
Public Class Form1
Dim myclient As New AmazonSimpleNotificationServiceClient
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim snsreq As New PublishRequest
Dim snsres As New PublishResponse
Dim snsmsgstng As New Dictionary(Of String, MessageAttributeValue)()
snsmsgstng.Add("AWS.SNS.SMS.SenderID", New MessageAttributeValue() With {.StringValue = "testing", .DataType = "string"})
snsmsgstng.Add("AWS.SNS.SMS.SMSType", New MessageAttributeValue() With {.StringValue = "Promotional", .DataType = "string"})
snsreq.MessageAttributes = snsmsgstng
snsreq.PhoneNumber = "+972543784512" 'phone No
snsreq.Message = "you get message ,if yes then tells me???.."
snsres = myclient.Publish(snsreq)
End Sub
End Class
И я добавляю следующий код в файл app.config
<appSettings >
<add key="AWSAccessKey" value="MYAWSAccessKey" />
<add key="AWSSecretKey" value="MYAWSSecretKey"/>
<add key="AWSRegion" value="ap-southeast-1"/>
</appSettings>
Я не знаю, где проблема в коде.