Module Description
This module handles the push_notification
hook generated by mod_pubsub
with an active push
node.
Each push_notification
hook is converted as a REST
API call to the MongoosePush service.
The following publish-options
that are added to the hook are directly passed to MongoosePush
:
mode
- if not supplied,prod
value will be usedclick_action
- optional. Seeclick_action
in the FCM documentation orcategory
in the APNS documentation.topic
- null if not suppliedservice
- has to be specified and the value must be valid and supported by the MongoosePush push service provider. E.g.fcm
,apns
.device_id
- has to be specified and the value must be valid device token received from push notification service provider specified inservice
option
In addition to those publish-options
you may also specify a silent
option,
which, when set to true
will result in "silent" notification.
Silent notifications send only data payload to push notifications service provider with all
fields specified in the notification without any modification and/or filtering.
Prerequisites
This module uses a connection pool via mongoose_http_client
.
It must be defined in outgoing_pools setting.
Options
- pool_name (atom, required) - name of the pool to use (as defined in
outgoing_pools
) - api_version (string, default:
v3
) - REST API version to be used. - max_http_connections (integer, default: 100) - the maximum amount of concurrent http connections
Example configuration
{outgoing_pools,
{http, global, mongoose_push_http, [],
[{server, "https://localhost:8443"}]
}
]}.
{mod_push_service_mongoosepush, [
{pool_name, mongoose_push_http}
{api_version, "v3"}
]}.