Namespaces
ovok.push
Register the signed-in person's devices for push, and set up the provider the project's push goes through.
- Stable unknown
- Release candidate not available
- Development not available
ovok.push has two halves. devices is the app's side: register the device a person signed in on, list their devices and remove one. provider holds the project's push provider and is for project admins. Providers are fcm, apns, expo and relay, which posts each push to an HTTPS endpoint of your own.
Register a device
const device = await ovok.push.devices.register({
token: expoPushToken,
platform: 'ios',
appId: 'com.example.care',
});- Register after sign-in, and again whenever the token changes. Registering the same token again answers the same device.
- The device belongs to the signed-in profile: a patient, practitioner or related person.
- The token is never returned.
listshows each device'sid,platform,appIdandregisteredAt.
Remove a device
await ovok.push.devices.unregister(device.id);- Call it on sign-out, so the device gets no more push for that person.
Set up the provider
const { secret } = await ovok.push.provider.create({ provider: 'relay', url: 'https://push.example.com/ovok' });
await ovok.push.provider.update({ provider: 'apns', environment: 'production' });
await ovok.push.provider.remove();createchecks the credentials with the provider first. A relay'swhsec_signing secret is answered this once; store it where your relay verifies requests.retrieveshows the provider and its settings, never a secret.updatenames the provider set up. To switch providers,removethe old one andcreatethe new one.- The calls go to
v1/push/devicesandv1/push/provider.
See also
- push API reference: every method and type.
- ovok.omnichannelAlerts for the rule that decides who hears of each alert.
- Errors and retries
Last updated on