无法在 Twilio 中发送短信
Can't able to send SMS in Twilio
尝试在 Java 中使用 Twilio 发送短信。
使用 com.twilio.sdk:twilio:7.+
版本。
邮件正文:
You have a new lead - Move 100088
Name: Amruth
Phone number: 07712345678
Move type: OFFICE
Move date: 24 October 2017, 06:33 PM
Moving from: BA1 3AW
Moving to: Bristol Street, Costa Mesa, CA, United States
Please login to your buzzmovePRO account to see details of this lead.
这是我的代码:
Twilio.init(ProjectConfig.TWILIO_ACCOUNT_SID, ProjectConfig.TWILIO_AUTH_TOKEN);
Message message = Message.creator(
new PhoneNumber("+447....988"),//Valid UK NO
new PhoneNumber("+441....57502"), //Valid UK NO
twilioMessage //Body is equal to above text
).create();
但低于错误,但我正在使用有效的 ACCOUNT SID
和 AUTH TOKEN
Instantiation of [simple type, class com.twilio.rest.api.v2010.account.Message] value failed: org.joda.time.DateTime.parse(Ljava/lang/String;Lorg/joda/time/format/DateTimeFormatter;)Lorg/joda/time/DateTime;
您的帮助将不胜感激。
问题已通过在 Gradle 文件中添加 joda-time
依赖关系得到解决。
Twilio 文档中没有提到。
这里添加依赖:
compile group: 'joda-time', name: 'joda-time', version: '2.3'
尝试在 Java 中使用 Twilio 发送短信。
使用 com.twilio.sdk:twilio:7.+
版本。
邮件正文:
You have a new lead - Move 100088
Name: Amruth
Phone number: 07712345678
Move type: OFFICE
Move date: 24 October 2017, 06:33 PM
Moving from: BA1 3AW
Moving to: Bristol Street, Costa Mesa, CA, United States
Please login to your buzzmovePRO account to see details of this lead.
这是我的代码:
Twilio.init(ProjectConfig.TWILIO_ACCOUNT_SID, ProjectConfig.TWILIO_AUTH_TOKEN);
Message message = Message.creator(
new PhoneNumber("+447....988"),//Valid UK NO
new PhoneNumber("+441....57502"), //Valid UK NO
twilioMessage //Body is equal to above text
).create();
但低于错误,但我正在使用有效的 ACCOUNT SID
和 AUTH TOKEN
Instantiation of [simple type, class com.twilio.rest.api.v2010.account.Message] value failed: org.joda.time.DateTime.parse(Ljava/lang/String;Lorg/joda/time/format/DateTimeFormatter;)Lorg/joda/time/DateTime;
您的帮助将不胜感激。
问题已通过在 Gradle 文件中添加 joda-time
依赖关系得到解决。
Twilio 文档中没有提到。
这里添加依赖:
compile group: 'joda-time', name: 'joda-time', version: '2.3'