1

我想使用 c# 发送推送通知。这是我尝试过的。

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

调试代码,该SendMessages方法返回 this。

错误

知道我做错了什么吗?谢谢

4

1 回答 1

0

您尚未指定要发送的任何消息。在上面的示例中,它将是mensaje对象中的 MessageConfiguration 属性。

于 2019-02-05T22:29:39.183 回答