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 端點。