简体   繁体   English

未为Message类型定义方法creator(PhoneNumber,PhoneNumber,String)

[英]The method creator(PhoneNumber, PhoneNumber, String) is undefined for the type Message

sdk i'm using- twilio-java-sdk-7.0.0-rc-10-jar-with-dependencies.jar SDK我正在使用-twilio-java-sdk-7.0.0-rc-10-jar-with-dependencies.jar
I'm working on eclipse luna and ibm bluemix is the server. 我正在使用Eclipse Luna,而ibm bluemix是服务器。
the code- 编码-

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

the error- The method creator(PhoneNumber, PhoneNumber, String) is undefined for the type Message. 错误-未为消息类型定义方法creator(电话号码,电话号码,字符串)。
I try to solve this error by replacing creator with create. 我尝试通过将create替换为create来解决此错误。 The arguments are of type (String,PhoneNumber,PhoneNumber,String). 参数的类型为(String,PhoneNumber,PhoneNumber,String)。 I'm not sure what the first String is for. 我不确定第一个String是做什么的。 Please help me resolve this issue. 请帮助我解决此问题。 Thanks! 谢谢!

There are 6 classes called Message in Twilio. Twilio中有6个称为Message类。 See the Javadoc . 参见Javadoc

You need to figure out which one to use and add an import statement that imports the right one. 您需要弄清楚要使用哪个语句,并添加一个import语句以导入正确的语句。

You probably want to import com.twilio.rest.api.v2010.account.Message; 您可能要import com.twilio.rest.api.v2010.account.Message; as this Message class has a creator method that fits your invocation: 因为此Message类具有一个适合您的调用的creator方法:

static MessageCreator creator(PhoneNumber to, PhoneNumber from, String body)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM