1

I want to send a push notification using c#. This is what I've tried.

 var credentials = new BasicAWSCredentials("key", "secretkey");
 var a = new AmazonPinpointClient(credentials, RegionEndpoint.EUWest1);
 var mensaje = new SendMessagesRequest();
 mensaje.ApplicationId = "pinpoint proyect id";
 var request = new MessageRequest();
 ChannelType canal = Amazon.Pinpoint.ChannelType.GCM;
 var configuracionAdress = new AddressConfiguration();
 configuracionAdress.ChannelType = canal;
 string id = "device token";
  var dict = new Dictionary<string, AddressConfiguration>();
  dict.Add(id, configuracionAdress);
  request.Addresses = dict;
   var context = new Dictionary<string,string>();
  context.Add("Titulo", "Reunion");
  context.Add("Cuerpo", "Asistir");
  request.Context = context;

  mensaje.MessageRequest = request;
  a.SendMessages(mensaje);

debugging the code, the SendMessages method returns this.

error

any idea what I am doing wrong? thx

Jaime Cuellar
  • 464
  • 1
  • 5
  • 20

1 Answers1

0

You have not specified any message to sent. It will be a MessageConfiguration property in the mensaje object in your example above.