跳至內容

為一切會說 HTTP 的事物打造的 iOS Live Activity API

PushWard 是一個 iOS Live Activity API:傳送一個 HTTP 請求,它便即時出現在 iPhone 的 Lock Screen 與 Dynamic Island 上,持續即時更新,任務完成後自動消失。無需 ActivityKit 程式碼、無需 Xcode,您這邊也無需 App Store 審查。

什麼是 Live Activity?

Live Activity 是 iOS 的一項功能,可在 Lock Screen、Dynamic Island 與 StandBy 上顯示即時、一目了然的資訊 — 接收者完全不必開啟任何應用程式。與出現一次便沉入清單的推播通知不同,Live Activity 會保持固定並即時更新:逐步推進的建置、倒數的計時器、越來越近的外送。PushWard 把一個 HTTP 請求變成這樣的體驗。

API 的運作方式

建立活動、啟動、更新、結束 — 全部透過 PushWard 的 REST API 與您的整合金鑰完成。任何能傳送 HTTP 請求的服務,都能驅動人們一眼看到的內容。沒有 APNs 憑證,也不用撰寫用戶端程式碼;PushWard 透過 Apple Push Notification service 負責送達。

透過 HTTP 啟動、更新與結束 Live Activity
# 1. Create an activity
curl -X POST https://api.pushward.app/activities \
  -H "Authorization: Bearer hlk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "slug": "deploy", "name": "Deploy to production" }'

# 2. Start the Live Activity on the Lock Screen
curl -X PATCH https://api.pushward.app/activities/deploy \
  -H "Authorization: Bearer hlk_YOUR_KEY" \
  -H "Content-Type: application/merge-patch+json" \
  -d '{ "state": "ongoing", "content": {
    "template": "generic", "progress": 0.2,
    "state": "Building...", "accent_color": "cyan"
  } }'

# 3. End it when the task is done
curl -X PATCH https://api.pushward.app/activities/deploy \
  -H "Authorization: Bearer hlk_YOUR_KEY" \
  -H "Content-Type: application/merge-patch+json" \
  -d '{ "state": "ended", "content": {
    "template": "generic", "progress": 1, "state": "Deployed"
  } }'

每種更新都有對應的範本

從為不同用途打造的 Live Activity 範本中挑選 — 通用進度列、倒數計時、步驟序列、警報、儀表、時間軸迷你圖、方塊看板或即時事件日誌。每個範本都有為 Lock Screen 與 Dynamic Island 調校的版面配置。

瀏覽範本 →

與您的技術棧協同運作

直接從您已在執行的工具傳送 Live Activities。現成的橋接與託管的 webhook relay 涵蓋 Grafana 警報、Home Assistant 自動化、GitHub Actions、SABnzbd 下載、Bambu Lab 列印、ArgoCD 同步,以及任何能傳送 JSON 的服務。

查看所有整合 →

試用 iOS Live Activity API

在 playground 中觀看 Live Activity 出現在模擬 iPhone 上,或閱讀入門指南,幾分鐘內用 curl 傳送您的第一個。