【发布时间】:2019-08-03 01:16:58
【问题描述】:
我正在使用 Twilio Rest-Api 从我的 Controller 类发送 SMS,它返回:Id = 166,Status = WaitingForActivation,Method = "{null}",Result = "{Not yet computed}"
public Task SendSmsAsync(string number, string message)
{
var accountSid = Options.SMSAccountIdentification;
var authToken = Options.SMSAccountPassword;
TwilioClient.Init(accountSid, authToken);
return MessageResource.CreateAsync(
to: new PhoneNumber(number),
from: new PhoneNumber(Options.SMSAccountFrom),
body: message);
}
我从 Controller 类调用这个方法:
var result = _smsSender.SendSmsAsync("+92331234566", "Hi its my first msg to ya. Twilio")
它正在返回状态:waitingForActivation。
如果我使整个过程异步,这会解决吗?虽然我已经尝试过了,但不知何故我没有找到解决方案。
【问题讨论】:
标签: sms twilio twilio-api two-factor-authentication