0

Using Twilio, I'm trying to send a WhatsUp location. twilio doc

Maven dependency

    <dependency>
        <groupId>com.twilio.sdk</groupId>
        <artifactId>twilio</artifactId>
        <version>7.42.0</version>
    </dependency>

Sample code

Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
    Message message = Message.creator(
            new com.twilio.type.PhoneNumber("whatsapp:+15005550006"),
            new com.twilio.type.PhoneNumber("whatsapp:+14155238886"),
            "Twilio HQ")
        .setPersistentAction(
            Arrays.asList("geo:37.787890,-122.391664|375 Beale St"))
        .create();

I'm getting below error

The method setPersistentAction(Arrays.asList(geo)) is undefined for the type MessageCreator

Athavan
  • 9
  • 5

1 Answers1

0

Have you upgraded your Twilio Java Helper library SDK? Usually newer functionality requires an upgrade. It looks like 7.45.1 added it: Read Status and Location Message Available on the Twilio API for Whatsapp

Release Notes

Alan
  • 10,465
  • 2
  • 8
  • 9