notifier_event into per-device deliveries.
Turns a parsed notifier_event into per-device deliveries.
tokens plus, when the
token store is enabled, every token registered to its
user_ids (restricted to the event's providers, minus
exclude_device_ids). Duplicates are dropped.notifier_fcm / notifier_apns) — either
asynchronously through the worker pools (submit/1) or
in parallel in the caller (submit_sync/1).last_success on success, delete the token when the provider
says it is dead (FCM UNREGISTERED, APNs 410, ...).outcome() = ok | {dead, Status::atom(), Detail::term()} | {failed, Status::atom(), Detail::term()}
| deliver/2 | Deliver one event to one device and record the outcome. |
| resolve_targets/1 | The explicit tokens of an event plus the stored tokens of its users. |
| status_of/1 | The status atom of an outcome, as reported by the HTTP API. |
| submit/1 | Resolve targets and enqueue one asynchronous delivery per target. |
| submit_sync/1 | Resolve targets and deliver to all of them in parallel, waiting for every per-device outcome (bounded by a 30 s overall timeout). |
deliver(Event::notifier_event:event(), Target::notifier_event:target()) -> outcome()
Deliver one event to one device and record the outcome.
Never raises: a crash inside a provider becomes {failed, internal_error, _}.
resolve_targets(Event::notifier_event:event()) -> {ok, [notifier_event:target(), ...]} | {error, no_targets | token_store_disabled}
The explicit tokens of an event plus the stored tokens of its users.
status_of(X1::outcome()) -> atom()
The status atom of an outcome, as reported by the HTTP API.
submit(Event::notifier_event:event()) -> {ok, #{id := binary(), targets := non_neg_integer()}} | {error, no_targets | token_store_disabled}
Resolve targets and enqueue one asynchronous delivery per target.
submit_sync(Event::notifier_event:event()) -> {ok, #{id := binary(), results := [{notifier_event:target(), outcome()}]}} | {error, no_targets | token_store_disabled}
Resolve targets and deliver to all of them in parallel, waiting for every per-device outcome (bounded by a 30 s overall timeout).
Generated by EDoc