2017-06-20 26 views
2

私はAWSを初めて使用しており、確認メッセージとしてSMSをエンドユーザのポスト予約に送信するようにシステムを設定しようとしています。Amazon AWS SNS SMSを送信できませんでした。返信ステータスは「WaitingForActivation」

私が今までやった以下:

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); 

私は任意のSMSを受信しませんでしたが。

私は、コードをデバッグするように、私は、メッセージの下に見た: enter image description here

誰も助けてくださいことができます。

答えて

2

私は合計で、全体の流れが

のようなものです がAWS.SNS.SMS.SMSType

にAWS.SNS.SMS.SenderID とsMSTypeへのSenderIDを変更し、以下の変更で、この問題をresoved単一のSMSを送信するための簡単な方法以下の簡単な通知v3.3.5.12

  • 使用するAWSSDKため

    1. ダウンロードナゲット。以下

    成功する方法を構築し、私はあなたのコードを試してみました。このだってのためにログをチェックするためにC#.NETのコア1.1

    AmazonSimpleNotificationServiceClient smsClient = new AmazonSimpleNotificationServiceClient(my_access_key, my_secret_key, Amazon.RegionEndpoint.APSoutheast2); 
    
    
           var smsAttributes = new Dictionary<string, MessageAttributeValue>(); 
    
           MessageAttributeValue senderID = new MessageAttributeValue(); 
           senderID.DataType = "String"; 
           senderID.StringValue = "mySenderId"; 
    
           MessageAttributeValue sMSType = new MessageAttributeValue(); 
           sMSType.DataType = "String"; 
           sMSType.StringValue = "Transactional"; 
    
           MessageAttributeValue maxPrice = new MessageAttributeValue(); 
           maxPrice.DataType = "Number"; 
           maxPrice.StringValue = "0.5"; 
    
           CancellationTokenSource source = new CancellationTokenSource(); 
           CancellationToken token = source.Token; 
    
    
           smsAttributes.Add("AWS.SNS.SMS.SenderID", senderID); 
           smsAttributes.Add("AWS.SNS.SMS.SMSType", sMSType); 
           smsAttributes.Add("AWS.SNS.SMS.MaxPrice", maxPrice); 
    
           PublishRequest publishRequest = new PublishRequest(); 
           publishRequest.Message = "This is 2nd sample message"; 
           publishRequest.MessageAttributes = smsAttributes; 
           publishRequest.PhoneNumber = "received phone no with + and country code"; 
    
           Task<PublishResponse> result = smsClient.PublishAsync(publishRequest, token); 
    
  • +0

    での作業の抜粋ですが、それはSMSを送信していないもあなたが –

    +1

    すべてのエラーを与えますデバッグを使用してタスク結果のステータスを確認するか、AWSコンソールでSNSレポートのバケットを定義してレポートを確認できます。これを最初に試している場合、AWSはSMSの使用限度額をそのアカウントの$ 1に制限しているため、SMSクォータ制限の引き上げ要求を提起する必要があります。クォータが使い尽くされているかどうかを確認するには、SNSコンソールからSMSを送信してみてください。 –

    関連する問題