开始使用
先在 App 验证邮箱并完成设备设置,再使用 CLI 登录并在 iOS 批准发送来源。网页登录或新增 Key 不会替代加密授权。
npm --prefix cli ci
node cli/src/main.js login --api https://api.pushnow.dev --name "My automation"
node cli/src/main.js send --title "Build complete" --body "Ready for review"以上命令从仓库根目录运行,不依赖已发布的 npm 包。
接口与凭据
https://api.pushnow.dev
| Method | Path | Credential | Purpose |
|---|---|---|---|
| GET | /v1/secure/devices | Account session | List your devices |
| GET | /v2/keys | Account session | List sender Key metadata |
| GET | /v2/logs | Account session | Inspect notification attempts |
| GET | /v2/recipients | Sender Key | Read the signed recipient directory |
| POST | /v2/messages | Sender Key | Submit an encrypted envelope |
| POST / PUT | /v2/attachments[/<ID>] | Sender Key | Reserve and upload encrypted files |
发送约定
POST /v2/messages 接收 SDK 生成的加密 envelope,不能直接提交明文标题和正文。Idempotency-Key 必须等于 message_id,重试需复用原始加密内容。
- 省略 notify_device_ids 默认提醒全部符合条件的设备;空数组仅保存到收件箱。
- scheduled_at 支持未来 30 天内的提醒,消息会立即出现在历史中。
- 支持加密标题、正文、链接和附件。当前不支持自定义通知声音。
- accepted 表示服务商已接受,不代表设备已显示通知。