RCS 消息
RCS(Rich Communication Services,富通信服务)是面向 Android 设备的下一代消息服务,提供富媒体、交互功能以及超越传统 SMS 的高级特性。
概述
RCS 提供增强的消息功能:
- 富媒体(图片、视频、GIF)
- 交互式按钮和轮播
- 已读回执和正在输入提示
- 更高的字符上限(最多 3072 个字符)
- 更完善的送达跟踪
- 品牌发送方标识
可用性
- 平台:仅限 Android 设备
- 网络:需要运营商支持 RCS
- 回退:RCS 不可用时自动回退为 SMS
基础 RCS 消息
请求
{
"from": "YourBrand",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Your RCS message text with rich formatting"
}
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
from | string | 是 | 字母数字发送方 ID |
to | string | 是 | 收件人手机号码(E.164) |
type | string | 是 | 设置为 "rcs" |
text | string | 是 | 消息内容(最多 3072 个字符) |
messageData | object | 否 | 富媒体和按钮 |
消息类型
纯文本
字符上限更高的简单文本消息:
{
"from": "YourBrand",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Welcome to our service! RCS allows us to send much longer messages with rich formatting and interactive elements."
}
文本 + 图片
{
"from": "YourBrand",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Check out our new product!",
"messageData": {
"media": {
"url": "https://example.com/product.jpg",
"type": "image/jpeg",
"height": 600,
"width": 800
}
}
}
文本 + 图片 + 按钮
{
"from": "YourStore",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Summer Sale - Up to 50% off!",
"messageData": {
"media": {
"url": "https://example.com/sale-banner.jpg",
"type": "image/jpeg"
},
"buttons": [
{
"text": "Shop Now",
"action": {
"type": "openUrl",
"url": "https://example.com/sale"
}
}
]
}
}
文本 + 视频
{
"from": "YourBrand",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Watch our product demo",
"messageData": {
"media": {
"url": "https://example.com/demo.mp4",
"type": "video/mp4",
"thumbnail": "https://example.com/thumbnail.jpg"
}
}
}
文本 + 多个按钮
{
"from": "YourService",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Your order #12345 is ready for pickup",
"messageData": {
"buttons": [
{
"text": "Track Order",
"action": {
"type": "openUrl",
"url": "https://example.com/track/12345"
}
},
{
"text": "Contact Support",
"action": {
"type": "dial",
"phoneNumber": "+380XXXXXXXXX"
}
},
{
"text": "Cancel Order",
"action": {
"type": "openUrl",
"url": "https://example.com/cancel/12345"
}
}
]
}
}
RCS 轮播
在可滚动的轮播中展示多个条目:
{
"from": "YourStore",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Featured Products",
"messageData": {
"carousel": {
"cards": [
{
"title": "Product A",
"description": "Premium quality product",
"media": {
"url": "https://example.com/product-a.jpg",
"type": "image/jpeg"
},
"buttons": [
{
"text": "Buy Now",
"action": {
"type": "openUrl",
"url": "https://example.com/product-a"
}
},
{
"text": "Details",
"action": {
"type": "openUrl",
"url": "https://example.com/product-a/details"
}
}
]
},
{
"title": "Product B",
"description": "Best seller",
"media": {
"url": "https://example.com/product-b.jpg",
"type": "image/jpeg"
},
"buttons": [
{
"text": "Buy Now",
"action": {
"type": "openUrl",
"url": "https://example.com/product-b"
}
}
]
}
]
}
}
}
按钮操作
打开 URL
{
"text": "Visit Website",
"action": {
"type": "openUrl",
"url": "https://example.com"
}
}
拨打电话号码
{
"text": "Call Us",
"action": {
"type": "dial",
"phoneNumber": "+380XXXXXXXXX"
}
}
发送位置
{
"text": "Share Location",
"action": {
"type": "shareLocation"
}
}
日历事件
{
"text": "Add to Calendar",
"action": {
"type": "createCalendarEvent",
"title": "Appointment",
"startTime": "2025-01-25T14:00:00Z",
"endTime": "2025-01-25T15:00:00Z"
}
}
媒体规格
图片
- 格式:JPEG、PNG、GIF
- 最大大小:2MB
- 推荐分辨率:800x600 或 1200x800
- 宽高比:16:9 或 4:3
视频
- 格式:MP4、3GP
- 最大大小:10MB
- 最长时长:2 分钟
- 推荐分辨率:1280x720
音频
- 格式:MP3、AAC
- 最大大小:5MB
- 最长时长:5 分钟
回退为 SMS
在以下情况下,RCS 会自动回退为 SMS:
- 收件人没有 RCS
- 收件人设备上已禁用 RCS
- 网络不支持 RCS
{
"from": "YourBrand",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Check out our new product!",
"messageData": {
"media": {
"url": "https://example.com/product.jpg",
"type": "image/jpeg"
},
"buttons": [
{
"text": "Shop Now",
"action": {
"type": "openUrl",
"url": "https://example.com/shop"
}
}
]
},
"fallback": {
"type": "sms",
"text": "Check out our new product! Visit: https://example.com/shop"
}
}
使用场景
电子商务
{
"from": "YourStore",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Your order has been shipped!",
"messageData": {
"media": {
"url": "https://example.com/package.jpg",
"type": "image/jpeg"
},
"buttons": [
{
"text": "Track Package",
"action": {
"type": "openUrl",
"url": "https://example.com/track/ABC123"
}
},
{
"text": "Contact Support",
"action": {
"type": "dial",
"phoneNumber": "+380XXXXXXXXX"
}
}
]
}
}
银行业务
{
"from": "YourBank",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Low balance alert: Your account balance is $50",
"messageData": {
"buttons": [
{
"text": "View Balance",
"action": {
"type": "openUrl",
"url": "https://bank.example.com/balance"
}
},
{
"text": "Transfer Money",
"action": {
"type": "openUrl",
"url": "https://bank.example.com/transfer"
}
}
]
}
}
旅行
{
"from": "YourAirline",
"to": "+380XXXXXXXXX",
"type": "rcs",
"text": "Your flight is departing in 3 hours",
"messageData": {
"media": {
"url": "https://example.com/boarding-pass.jpg",
"type": "image/jpeg"
},
"buttons": [
{
"text": "Check-in",
"action": {
"type": "openUrl",
"url": "https://airline.example.com/checkin"
}
},
{
"text": "Add to Calendar",
"action": {
"type": "createCalendarEvent",
"title": "Flight Departure",
"startTime": "2025-01-25T10:00:00Z"
}
}
]
}
}
最佳实践
内容
- ✅ 使用高质量图片(至少 800x600)
- ✅ 按钮文字保持简短(2-3 个词)
- ✅ 为富内容提供 SMS 回退
- ✅ 在不同的 Android 设备上测试
- ❌ 每条消息的按钮不要超过 4-5 个
- ❌ 避免使用大型视频文件(>5MB)
媒体
- 所有媒体均使用 HTTPS URL
- 针对移动端优化图片
- 为无障碍访问添加替代文本
- 发送前测试媒体 URL
按钮
- 每条消息最多 4 个按钮
- 清晰的行动号召文案
- 测试所有按钮操作
- 考虑为不可用的操作提供回退方案
品牌
- 使用一致的发送方 ID
- 在适当的位置加入品牌标志
- 保持品牌的语气和风格
- 确保视觉一致性
送达状态
RCS 提供增强的送达跟踪:
- 已发送:消息已发送至运营商
- 已送达:消息已送达设备
- 已读:收件人已打开消息
- 失败:送达失败,已触发回退
可使用状态端点查看状态。