push
Push notifications (Web Push): the app reaches a person on their devices when something waits on them, the app closed or out of sight.
On this page 7
import { push } from "pairz/plugins/interfaces";What it keeps
It keeps 2 collections, 1 of them on the record.
| Collection | Kept as | Fields |
|---|---|---|
pushLooking | in memory, gone on restart | person, visible, at |
pushSubscription | documents | person, device, at; private: endpoint, keys |
Its named queries read for callers, as the rules let them:
| Query | Who outside runs it |
|---|---|
pushSubscription.mine | people, agents for a person, keys and routines |
What it lets callers do
Of its 5 Actions, people may call 4; agents may call 1; contacts and someone signed out may call none.
| Action | Person | Agent | Contact | Anyone | Key | Routine | What it does |
|---|---|---|---|---|---|---|---|
push.key | yes | yes | no | no | yes | yes | The app's public key for push notifications, or null when they're off. |
push.looking | yes | no | no | no | no | no | Says whether a tab of yours shows the app now. |
push.send | no | no | no | no | no | no | Sends a notification to a person's devices. |
push.subscribe | yes | no | no | no | no | no | Turns notifications on for this device. |
push.unsubscribe | yes | no | no | no | no | no | Turns notifications off for one of your devices: this one, or one in your list. |
An agent works for a person, and calls what both may. A key calls only what its scope names. A routine is work done for a person, which they set going.
It also adds rules every read and write keeps to (guard).
Where it shows
It has no Views of its own: its front ends show it, push-web.
What it needs
Nothing to set. It reads push, resource kinds the app and other plugins fill.
What it requires
It builds on no other plugin.
It ships with pairz@1.0.0-rc.82.
What it does on its own
Some of its work starts without a caller: an event, or the time.
push.askedruns onapproval.created.push.messageruns onmessage.created.
Listing
It keeps every listing rule.