我正在使用的 sdk-twilio-java-sdk-7.0.0-rc-10-jar-with-dependencies.jar
我正在处理 eclipse luna,而 ibm bluemix 是服务器。
编码-
String ACCOUNT_SID = "ACa0c22e33e95dcaf9a0b1370748855769";
String AUTH_TOKEN = "[auth-token]"; //pasted the correct token here
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
Message.creator(new PhoneNumber("+91"+rsa.getString(2)),
new PhoneNumber("+12014904147"),
"Congrats, "+rsa.getString(3)+"! Your booking for the event has been confirmed. You will be contacted by the event representatives soon.")
.create();
错误 - 消息类型的方法创建者(电话号码,电话号码,字符串)未定义。
我尝试通过用 create 替换 creator 来解决这个错误。参数的类型为 (String,PhoneNumber,PhoneNumber,String)。我不确定第一个 String 是做什么用的。请帮我解决这个问题。谢谢!
Message
Twilio 中有 6 个类。请参阅Javadoc。
您需要确定使用哪一个并添加一条import
语句来导入正确的语句。
您可能希望import com.twilio.rest.api.v2010.account.Message;
因为这个 Message 类有一个creator
适合您的调用的方法:
static MessageCreator creator(PhoneNumber to, PhoneNumber from, String body)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句