-
Notifications
You must be signed in to change notification settings - Fork 3
how to send a message
찰스 edited this page Jul 31, 2023
·
3 revisions
using (var client = new LineMessagingClient("your channelacesstoken"))
{
await client.Message.SendPushMessageAsync("user id", new TextMessage("hello world"));
}
using (var client = new LineMessagingClient("your channelacesstoken"))
{
await client.Message.SendPushMessageAsync(
"user id",
new TextMessage("hello world"),
xLineRetryKey: Guid.NewGuid().ToString());
}
offer LineDevelopers v1.1.10 or higher
using (var client = new LineMessagingClient("your channelaccesstoken"))
{
await client.Message.SendPushMessageAsync(
"user id",
new TextMessage("hello world"),
xLineRetryKey: Guid.NewGuid().ToString(),
getResponseHeaders: (o) =>
{
IEnumerable<string> xLineRequestId;
IEnumerable<string> xLineAcceptedRequestId;
if (o.TryGetValues("X-Line-Request-Id", out xLineRequestId))
{
Console.WriteLine(xLineRequestId.First());
}
if (o.TryGetValues("X-Line-Accepted-Request-Id", out xLineAcceptedRequestId))
{
Console.WriteLine(xLineAcceptedRequestId.First());
}
});
}
LINE Developers.NET WIKI