Protocol definitions for push notification delivery, device management, and analytics.
Protocol definitions for push notification delivery, device management, and analytics.
(apns-send! this payload device-token)Send APNs notification. Returns {:success? bool :apns-id str :error map}
Send APNs notification. Returns {:success? bool :apns-id str :error map}
(apns-send-batch! this payload device-tokens)Send to multiple APNs devices. Returns per-token results.
Send to multiple APNs devices. Returns per-token results.
Optional beside IDeviceTokenStore: a store without it is scanned instead.
Optional beside IDeviceTokenStore: a store without it is scanned instead.
(find-user-devices this user-id device-token app-id)The user's active devices with this token, only under app-id unless it is nil.
The user's active devices with this token, only under app-id unless it is nil.
Optional beside IDeviceTokenStore: removes the token in one tenant, where
unregister-device! removes it in every tenant (BOU-990).
Optional beside IDeviceTokenStore: removes the token in one tenant, where `unregister-device!` removes it in every tenant (BOU-990).
(remove-device! this user-id device-token tenant-id)Remove the user's registrations of the token in the tenant, active or not; a nil tenant-id names no tenant's.
Remove the user's registrations of the token in the tenant, active or not; a nil tenant-id names no tenant's.
(cleanup-stale-tokens! this max-age-days)Purge tokens not used within max-age-days.
Purge tokens not used within max-age-days.
(get-devices-by-platform this platform opts)Active devices for platform, ordered by id. opts: {:limit n :after-id id}: keyset paging, so deactivating a device mid-broadcast shifts no page. With :tenant-id, only that tenant's devices.
Active devices for platform, ordered by id. opts: {:limit n :after-id id}:
keyset paging, so deactivating a device mid-broadcast shifts no page.
With :tenant-id, only that tenant's devices.(get-user-devices this user-id)All active devices for user.
All active devices for user.
(mark-token-invalid! this device-token)Flag token as invalid after provider rejection.
Flag token as invalid after provider rejection.
(register-device! this user-id device-info)Store device token. device-info: {:token str :platform kw :app-id str},
and :tenant-id, the tenant it was registered in, which sends filter on.
Throws {:type :conflict} when another tenant holds the token, under any
app-id: a token is one device (BOU-994).
Store device token. device-info: {:token str :platform kw :app-id str},
and :tenant-id, the tenant it was registered in, which sends filter on.
Throws `{:type :conflict}` when another tenant holds the token, under any
app-id: a token is one device (BOU-994).(unregister-device! this user-id device-token)Remove device token.
Remove device token.
(fcm-send! this payload)Send FCM message. Returns {:success? bool :message-id str :error map}
Send FCM message. Returns {:success? bool :message-id str :error map}
(fcm-send-multicast! this payload tokens)Send to multiple FCM tokens. Returns per-token results.
Send to multiple FCM tokens. Returns per-token results.
(fcm-validate-token this token)Dry-run send to check token validity.
Dry-run send to check token validity.
Optional beside IFCMProvider and IAPNsProvider: each device its own payload, sent concurrently. Without it, push sends to each device in turn.
Optional beside IFCMProvider and IAPNsProvider: each device its own payload, sent concurrently. Without it, push sends to each device in turn.
(send-each! this sends)sends: [[device-token payload] ...]. Per-token results, in order.
sends: [[device-token payload] ...]. Per-token results, in order.
(cleanup-old-events! this retention-days)Purge analytics events older than retention-days.
Purge analytics events older than retention-days.
(get-push-stats this notification-id opts)Aggregate stats: sent/delivered/opened/failed counts.
Aggregate stats: sent/delivered/opened/failed counts.
(record-delivery! this event)Log client-reported delivery confirmation.
Log client-reported delivery confirmation.
(record-open! this event)Log client-reported notification open.
Log client-reported notification open.
(record-send! this event)Log send attempt with provider response.
Log send attempt with provider response.
(broadcast! this notification-id data opts)Send to all registered devices matching opts: {:platform kw, :app-id str,
:tenant-id, :all-tenants? bool}, kept to a tenant as send-push!.
Send to all registered devices matching opts: {:platform kw, :app-id str,
:tenant-id, :all-tenants? bool}, kept to a tenant as `send-push!`.(schedule-push! this notification-id data opts scheduled-at)Schedule push for future delivery via jobs. opts as send-push!.
Schedule push for future delivery via jobs. opts as `send-push!`.
(send-push! this notification-id data opts)Enqueue push delivery for all user devices. opts: {:user-id uuid, :locale kw,
:tenant-id, :all-tenants? bool}. The bound tenant wins over :tenant-id; with
neither, only devices of no tenant are reached, every tenant's only with
:all-tenants? true outside a tenant.
Enqueue push delivery for all user devices. opts: {:user-id uuid, :locale kw,
:tenant-id, :all-tenants? bool}. The bound tenant wins over `:tenant-id`; with
neither, only devices of no tenant are reached, every tenant's only with
`:all-tenants? true` outside a tenant.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |