简体   繁体   中英

Can't able to send SMS in Twilio

Trying to send SMS using Twilio in Java.

Using com.twilio.sdk:twilio:7.+ version.

Message body :

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.


Here is my code:

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

But getting below error, but am using valid ACCOUNT SID and 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;


Your help will be more appreciated.

The issue has been resolved by adding joda-time dependency in Gradle file.

Which is not mentioned in Twilio document.

Here adding dependency :

compile group: 'joda-time', name: 'joda-time', version: '2.3'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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