gpt4 book ai didi

java - Twilio 在 Whatsapp 中发送位置

转载 作者:行者123 更新时间:2023-12-01 17:58:10 25 4
gpt4 key购买 nike

我正在尝试使用 Twilio 发送 WhatsUp 位置。 twilio doc

Maven 依赖

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

示例代码

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

我遇到以下错误

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

最佳答案

您是否升级了 Twilio Java Helper 库 SDK?通常较新的功能需要升级。看起来7.45.1添加了它:Read Status and Location Message Available on the Twilio API for Whatsapp

Release Notes

关于java - Twilio 在 Whatsapp 中发送位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60680197/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com