View Source MongoosePush.Service behaviour (MongoosePush v2.2.0-dev)
Generic interface for push notifications services.
Summary
Types
Error tuple with unified internal representation and exact reason returned by service
Types
@type error() :: {error_type(), error_reason()}
Error tuple with unified internal representation and exact reason returned by service
@type error_reason() :: atom()
@type error_type() ::
:invalid_request
| :internal_config
| :auth
| :unregistered
| :too_many_requests
| :unspecified
| :service_internal
| :payload_too_large
| :unknown
@type notification() :: term()
@type options() :: [Keyword.t()]
Callbacks
@callback choose_pool(MongoosePush.mode(), [atom()]) :: MongoosePush.Application.pool_name() | nil
@callback prepare_notification( String.t(), MongoosePush.request(), MongoosePush.Application.pool_name() ) :: notification()
@callback push( notification(), String.t(), MongoosePush.Application.pool_name(), options() ) :: :ok | {:error, error()} | {:error, MongoosePush.error()}