OpenClaw BlueBubbles 渠道
通过 BlueBubbles REST API 将 OpenClaw 连接到 iMessage。此集成将您的 Mac 变为 iMessage 网关——安装 BlueBubbles 服务端应用,启用 Web API,您的 AI 助手即可收发 iMessage 消息、tapback 表情回应和媒体附件。BlueBubbles 是推荐的 iMessage 渠道,取代了旧版 imsg CLI 方案。
BlueBubbles 支持的功能
文本消息
支持
媒体与文件
支持
消息反应
支持
消息线程
不支持
语音消息
不支持
群聊
支持
BlueBubbles 前置条件
- 运行 macOS High Sierra (10.13) 或更高版本的 Mac(推荐 Ventura 13+ 以获得完整功能;Tahoe 26 有部分限制)
- 已安装 BlueBubbles 服务端应用(从 bluebubbles.app 下载)
- 在 BlueBubbles 配置中启用 Web API 并设置密码
- OpenClaw Gateway 已运行并配置
BlueBubbles 快速设置
在 Mac 上安装 BlueBubbles 服务端
从 bluebubbles.app/install 下载并安装 BlueBubbles 服务端应用。启动应用,使用 Apple ID 登录,并完成初始设置。确保 iMessage 在该 Mac 上正常工作。
启用 Web API
在 BlueBubbles 服务端设置中,启用 Web/REST API 并设置一个强密码。记下服务器 URL(例如 http://localhost:1234)——您将在 OpenClaw 配置中使用它。
添加 BlueBubbles 渠道配置
运行 'openclaw onboard' 并选择 BlueBubbles,或手动将渠道配置添加到 ~/.openclaw/openclaw.json,填入 serverUrl 和 password。如需要可配置 webhookPath。
配置 Webhook 并测试
将 BlueBubbles Webhook 指向您的 Gateway:https://your-gateway-host:3000/bluebubbles-webhook?password=<password>。启动 Gateway 并发送一条测试 iMessage 以验证连接。如使用 pairing 策略,通过 'openclaw pairing approve bluebubbles <code>' 审批发送者。
BlueBubbles 配置示例
{
"channels": {
"bluebubbles": {
"enabled": true,
"serverUrl": "http://localhost:1234",
"password": "YOUR_BLUEBUBBLES_PASSWORD",
"webhookPath": "/bluebubbles-webhook",
"dmPolicy": "pairing"
}
}
}BlueBubbles 深入了解
架构概览
BlueBubbles 服务端设置
# Gateway 的 Webhook URL 格式
https://your-gateway-host:3000/bluebubbles-webhook?password=YOUR_PASSWORD私聊策略
{
"channels": {
"bluebubbles": {
"dmPolicy": "allowlist",
"allowFrom": ["+15551234567", "user@example.com"]
}
}
}群聊管理
{
"channels": {
"bluebubbles": {
"groupPolicy": "allowlist",
"groupAllowFrom": ["+15551234567"],
"groups": {
"iMessage;+;chat123456": {
"requireMention": false
}
}
}
}
}iMessage 操作与特效
{
"channels": {
"bluebubbles": {
"actions": {
"reactions": true,
"edit": true,
"unsend": true,
"reply": true,
"sendWithEffect": true,
"sendAttachment": true
}
}
}
}消息发送与分块
{
"channels": {
"bluebubbles": {
"textChunkLimit": 4000,
"chunkMode": "newline",
"blockStreaming": false,
"sendReadReceipts": true
}
}
}媒体与附件
消息 ID 处理
地址与路由
安全与 Webhook 认证
Messages.app 保活(无头模式/虚拟机)
BlueBubbles 配置参考
| Key | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | false | 启用或禁用 BlueBubbles 渠道 |
| serverUrl | string | "" | BlueBubbles REST API 基础 URL(例如 http://localhost:1234) |
| password | string | "" | 用于认证的 BlueBubbles API 密码 |
| webhookPath | string | "/bluebubbles-webhook" | 接收传入消息的 Webhook 端点路径 |
| dmPolicy | string | "pairing" | 控制谁可以私聊机器人。选项:pairing, allowlist, open, disabled |
| allowFrom | string[] | [] | 允许发消息的电话号码和邮箱(电话使用 E.164 格式) |
| groupPolicy | string | "allowlist" | 群聊策略。选项:open, allowlist, disabled |
| groupAllowFrom | string[] | [] | 群聊中授权触发机器人的发送者地址 |
| sendReadReceipts | boolean | true | 处理消息时发送已读回执确认 |
| blockStreaming | boolean | false | 启用块式响应流,而非等待完整回复 |
| textChunkLimit | number | 4000 | 每条外发文本消息块的最大字符数 |
| chunkMode | string | "length" | 文本分割模式。选项:length(按大小), newline(按段落) |
| mediaMaxMb | number | 8 | 传入附件的最大文件大小(MB) |
| historyLimit | number | - | 作为 AI 上下文的最大群消息数(0 为禁用) |
| dmHistoryLimit | number | - | AI 上下文的私聊历史记录限制 |
| actions.reactions | boolean | true | 启用 tapback 表情回应(需要 Private API) |
| actions.edit | boolean | true | 启用消息编辑(需要 macOS 13+;Tahoe 上不可用) |
| actions.unsend | boolean | true | 启用消息撤回(需要 macOS 13+) |
| actions.reply | boolean | true | 启用通过 GUID 的消息线程 |
| actions.sendWithEffect | boolean | true | 启用 iMessage 气泡特效(猛击、响亮、温柔等) |
| actions.sendAttachment | boolean | true | 启用媒体和语音备忘录发送 |
启用或禁用 BlueBubbles 渠道
BlueBubbles REST API 基础 URL(例如 http://localhost:1234)
用于认证的 BlueBubbles API 密码
接收传入消息的 Webhook 端点路径
控制谁可以私聊机器人。选项:pairing, allowlist, open, disabled
允许发消息的电话号码和邮箱(电话使用 E.164 格式)
群聊策略。选项:open, allowlist, disabled
群聊中授权触发机器人的发送者地址
处理消息时发送已读回执确认
启用块式响应流,而非等待完整回复
每条外发文本消息块的最大字符数
文本分割模式。选项:length(按大小), newline(按段落)
传入附件的最大文件大小(MB)
作为 AI 上下文的最大群消息数(0 为禁用)
AI 上下文的私聊历史记录限制
启用 tapback 表情回应(需要 Private API)
启用消息编辑(需要 macOS 13+;Tahoe 上不可用)
启用消息撤回(需要 macOS 13+)
启用通过 GUID 的消息线程
启用 iMessage 气泡特效(猛击、响亮、温柔等)
启用媒体和语音备忘录发送
BlueBubbles 常见问题
BlueBubbles 故障排查
BlueBubbles 中的 Webhook URL 与 Gateway 端点不匹配,或密码参数不正确。
BlueBubbles Private API 未启用,或服务端版本不支持所需的 API 端点。
Messages.app 在无头/虚拟机环境下进入空闲状态,停止处理脚本接口。
接收方的电话号码或邮箱未注册 iMessage,或 Mac 上的 Apple ID 未启用 iMessage。
已知问题——macOS Tahoe (26) 破坏了消息编辑的 Private API 端点。