我正在使用 Twilio 沙盒将媒体文件发送到 WhatsApp 号码。
当我尝试多个媒体 URI 时,我只收到一个随机文件。
我能够成功发送一个文件。
List<URI> uriList = new ArrayList<URI>();
for (String uriStr : requestVO.getUri()) {
uriList.add(URI.create(uriStr));
}
message = Message
.creator(
new PhoneNumber(CommonMethods.formatMobileNumber(requestVO.getTo(),
WhatsappConstants.COUNTRY_CODE_IND)),
new PhoneNumber(CommonMethods.formatMobileNumber(WhatsappConstants.FROM_NUMBER,
WhatsappConstants.COUNTRY_CODE_US)),
requestVO.getMessage())
.setMediaUrl(uriList).create();
最佳答案
此处为 Twilio 开发人员布道师。
Twilio Whatsapp 不支持在一条消息中发送多个媒体附件。
Quoting the official website :
One media attachment is supported per message, with a size limit of 5MB.
要解决这个问题,您必须发送带有自己消息的每个媒体 URL。
关于java - 使用 twilio 沙箱在 whatsapp 上发送多条媒体消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57411684/