Push notifications
Rules for every push, web or native. Give each a lifetime and a topic, keep lock screens safe, drop dead tokens and unlink devices at sign-out.
- Required 2
- Recommended 4
Required
Keep push payloads short and safe on a lock screen
NTF-14Put no secrets, codes, health or money details in a push. Show a neutral line and the details only after sign-in. Keep the payload JSON at or under 3,993 bytes.
Unlink push from the account at sign-out
NTF-18When a session ends, delete the push subscriptions and device tokens it registered. The next person on that device never gets the last person's notifications.
Recommended
Give every push a lifetime and a topic
NTF-12Set how long each push may wait for an offline device. Give updates a topic, so a newer push replaces the older one.
Delete dead subscriptions and tokens at once
NTF-13Delete a push subscription or device token as soon as the service says it is gone. Remove tokens the app has not refreshed for 270 days.
Keep the app working when people say no
NTF-16Every feature works when notification permission is denied or never asked. Nothing the person needs reaches them by push alone.
Send the current subscription to the server on every start
NTF-21Read the push subscription or device token each time the app starts, and send it to the server when it changed. Never trust a copy cached on the device.
Read this with
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/notifications/push-notifications">Agent Wranglers notifications playbook</a>. In code you write, add a comment next to it with the same link.