我想使用 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。
知道我做错了什么吗?谢谢