我想知道我是否可以将媒体附加到 Twilio 聊天消息中。我对 Twilio 文档对此感到有点困惑:
- 帮助中心的 Programmable Chat file support for sending messages说它不受支持。
看起来这已经过时了? Programmable Chat's API Reference, "Channels and Messages" section说:
Today, a message is just a string of text. In the future, this may expand to include other media types, like images and binary data.
也过时了?
- This StackOverflow answer说可以发送多媒体消息,至少对于 JavaScript 是这样。看起来对于带有 TCHMessageOptions's withMediaStream:contentType:defaultFilename:onStarted:onProgress:onCompleted: 的 iOS 也是可能的方法。
- [题外话]使用上面的方法,貌似可以创建彩信,但是我也可以设置自定义属性吗?
你能解释一下吗?
谢谢!
最佳答案
此处为 Twilio 开发人员布道师。
Attaching media to messages in Twilio Programmable Chat 测试版 现已支持。似乎有些文档有点过时了,但是包含您要查找的代码和解释的页面在这里:https://www.twilio.com/docs/api/chat/guides/media-support .
至于发送自定义属性,每条消息都有一个 attributes
属性,您可以使用它来发送任意 JSON。
我现在正在努力更正误导性文档。感谢您指出!
关于ios - 具有媒体和自定义属性的 Twilio 可编程聊天消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47281923/