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 used
  • click_action - optional. See click_action in the FCM documentation or category in the APNS documentation.
  • topic - null if not supplied
  • service - 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 in service option

In addition to those publish-options you may specify also silent option, that 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 created by mongoose_http_client. It must be defined in http_connections setting.

Options

  • pool_name (atom, required) - name of the pool to use (as defined in http_connections)
  • api_version (string, default: v1) - REST API version to be used. Currently only v1 is supported

Example configuration

{http_connections, [{mongoose_push_http,
    [{server, "https://localhost:8443"}]
}]}.

{mod_push_service_mongoosepush, [
        {pool_name, mongoose_push_http}
        {api_version, "v1"}
]}.