push-notifications
Design push notifications — opt-in moment, payload shape, tap-deep-link, silent vs visible, quiet hours, unsub path; respect the OS bucket constraints.
- License 许可
- MIT
- 最近更新
- 2026-10-29
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- push-notifications
- description
- Design push notifications — opt-in moment, payload shape, tap-deep-link, silent vs visible, quiet hours, unsub path; respect the OS bucket constraints.
02 资源文件 1
- 参考文档routing.yaml317 B
03 SKILL.md 正文
push-notifications
Push is one of the easiest privileges to abuse. Output is the design that earns and keeps the permission — payload, timing, and the unsub path.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
When to use
- A new app or feature is introducing push notifications.
- An app's push opt-in rate / unsub rate has regressed.
- A workflow's user-engagement step needs structured push design.
Inputs
- The notification use cases (required): what event triggers each, and what the user can do with it.
- Platforms and the push provider (FCM, APNs direct, OneSignal, …) — optional; absent, design provider-neutral.
- Regulatory context (optional): marketing pushes need consent rules per region (e.g. ePrivacy/GDPR in the EU).
- Sending a push is a side effect: the design lists test sends; none go to real users without explicit approval.
Procedure
- Opt-in moment: never on app launch. Ask after the user has experienced enough value to want the notification. The contextual opt-in ("Get notified when your refund clears") wins over the cold OS prompt. Applies on both platforms: iOS requires authorization, and Android 13+ requires the runtime
POST_NOTIFICATIONSpermission. - Two channels minimum:
- Transactional: order updates, refund status, password resets. Default ON.
- Marketing / engagement: discounts, "we miss you". Default OFF; explicit opt-in. Make the user able to toggle each independently in-app.
- Payload shape — both iOS APNs and Android FCM:
title: scannable headline (≤ 32 chars on most lockscreens).body: 1–2 short sentences.data: structured fields the app uses to deep-link (e.g.{"type": "refund_complete", "refund_id": "ref_…"}). Do not put PII or amounts indata; minimize what the OS can persist.
- Tap behavior: deep-link to the specific entity, not the home screen. "Refund processed" tap → /refunds/<id>, not /.
- Silent vs visible:
- Visible: user-facing. Must have user value beyond "your app exists".
- Silent (data-only): app processes in background. iOS APNs limits volume; Android FCM has Doze constraints. Don't use silent push for engagement.
- Quiet hours: respect them. Default 22:00–08:00 user-local for non-time-sensitive notifications. Tag time-sensitive (e.g. iOS
interruption-level: time-sensitive) only when warranted. - Unsubscribe path: in-app settings reachable in ≤ 2 taps. Per-channel toggles. Honor "do not contact" as the strict-deny default.
- Delivery hygiene: dedupe retried sends with a collapse key (
apns-collapse-id, FCMcollapse_key) so a retry doesn't buzz twice; remove device tokens the provider reports invalid/unregistered. - Tracking: delivery rate, open rate, action rate, unsub rate. Alert when unsub rate doubles week-over-week.
OS constraints to respect
- iOS APNs: priority 10 (immediate) vs 5 (when convenient). Don't use 10 for marketing.
- Android FCM: high vs normal priority. High priority delivered through Doze; over-use gets the app reputation-flagged.
- Provisional auth (iOS): send to Notification Center without prompt; user promotes if useful. Good for low-stakes channels.
Output
Push design: refund-service
Channels:
Transactional (default ON):
- refund_initiated, refund_complete, refund_failed.
Marketing (default OFF, explicit opt-in):
- promo, feature-announcement — sent only after opt-in.
Opt-in moment:
After the user views the refund-status page once. Contextual prompt:
"Get notified when your refund clears."
Payload shape (refund_complete example):
title: "Refund complete"
body: "Your refund for order #1234 is on its way to your bank."
data: { type: "refund_complete", refund_id: "ref_…" }
iOS interruption-level: active (not time-sensitive).
Android priority: normal.
Tap behavior:
Deep-link to /refunds/<refund_id>.
Quiet hours:
22:00–08:00 user-local for all marketing; transactional respects unless
the user opted into time-sensitive.
Unsubscribe path:
Settings → Notifications → Refund updates toggle. Per-channel.
Tracking + alerts:
Alert: unsub rate doubles WoW for any channel → review the recent change.
Quality bar
- Opt-in is NOT at first launch.
- At least two channels with independent per-channel toggles.
- Tap deep-links to the entity, not the home.
- Quiet hours pinned.
- Unsub path reachable in ≤ 2 taps.
Anti-patterns to avoid
- Asking permission at app launch. Burns the only chance.
- One push channel for all notifications. User has to choose all-or-nothing.
- PII / amounts in the visible body that show on the lockscreen.
- Silent push for "engagement" — wastes battery and gets the app throttled.
- No unsub in-app, only via OS toggle. Frustrating; they'll uninstall.
04 同仓库更多 Skills
runbook
Write or refresh an operational runbook for an alert/symptom; structured as TL;DR + Pre-checks + Steps + Verification + Rollback + Escalation.
rfc
Draft a lightweight design RFC to docs/rfcs/<slug>.md; Summary, Motivation, Detailed design, Drawbacks, Alternatives, Unresolved questions. A proposal to debate, not a recorded decision (adr).
editorial-pass
Review and tighten prose in a Markdown artifact for a target tone (terse, formal, friendly) without dropping information; preserve quotations and load-bearing constraints.
architecture-review-facilitation
Run an architecture review as a process — entry criteria, reviewer checklist, decision log, and follow-up actions — pairing the design artifact with a red-team pass.
architecture-doc
Write a C4-style architecture document; System Context + Containers (+ Components when interesting) with mermaid diagrams. Describes structure, not a decision (adr) or proposal (rfc).
adr
Write an Architecture Decision Record (Michael Nygard format) to docs/adrs/NNNN-<slug>.md; frontmatter validated by the ADR artifact schema. Records a made decision, not a proposal to debate (rfc).