面向一切会说 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 负责送达。
# 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 发送您的第一个。