Node.js push notification server which is compatible with WebSub protocol.
App) that wants to receive push notifications from WebSub Publisher (Publisher) may register itself with this Push Server (Server).Server will subscribe on behalf of App with Publisher.Publisher publishes something, Server will forward the information to App via one of the supported push services.Notes:
npm start.
It is possible to have multiple separated instances of workers by using npm run worker.
In that case, it's recommended to disable the default one by setting env var CONFIG_PUSH_QUEUE_WORKER=false. app:
image: xfrocks/pushserver
environment:
- CONFIG_WEB_USERNAME=admin
- CONFIG_WEB_PASSWORD=123456
- MONGO_URI=mongodb://mongo/pushserver
- REDIS_URL=http://redis:6379
depends_on:
- mongo
- redis
ports:
- "80:18080"
See docker-compose.yml file for full example. Please note that the yml is for development purposes, it is not secure.
Send a POST request to /subscribe:
hub_uri (required)oauth_client_id (required)oauth_token (required)device_type (required): see Supported Services for explanationdevice_id (required): see Supported Services for explanationextra_data (optional)via argon/node-apn
Project configuration at /admin/projects/apn:
bundle_id (required): The iOS application Bundle IDtoken, an array of...key (required): The provider token key in plaintextkeyId (required): The ID of the key issued by AppleteamId (required): The team ID associated with the provider tokenproduction (optional): 1 for production, 0 for sandboxApp that wants to receive via APN must include these parameters during subscription:
device_type = iosdevice_id = APN Device Tokenextra_data[package] = Bundle IDvia firebase-admin (the official SDK)
Project configuration at /admin/projects/fcm, parameters:
project_id (required): The Google project IDclient_email (required)private_key (required)App that wants to receive via FCM must include these parameters during subscription:
device_type = firebasedevice_id = FCM Registration Tokenextra_data[project] = Project IDBy default, the server will push data messages...
extra_data[notification] if specified, notification messages will be pushed insteadextra_data[click_action] the action associated with a user click on the notification. Corresponds to category in the APNs payload.Project configuration at /admin/projects/gcm, parameters:
package_id (required): The Android application package IDapi_key (required): The API key for GCM (obtain via Google Developer Console)App that wants to receive via GCM must include theses parameters during subscription:
device_type = androiddevice_id = GCM Registration Tokenextra_data[package] = Package IDProject configuration at /admin/projects/hms, parameters:
app_id (required)app_secret (required)App that wants to receive via FCM must include these parameters during subscription:
device_type = huaweidevice_id = HMS Tokenextra_data[app] = App IDOptional extra_data params:
badge_class, badge_with_convo: control whether to include badge in pushesclick_action: android.notification.click_action.action will be set to this value (type=1)intent_prefix: android.notification.click_action.intent will be set with this prefix and content_type, convo_id or notification_id (if available)notification_default_title: required to receive notification for XenForo alert because HMS requires notification titlevia tjanczuk/wns
Project configuration at /admin/projects/wns, parameters:
package_id (required): The Windows application package IDclient_id (required): The Windows client IDclient_secret (required): The Windows client secretApp that wants to receive via WNS must include theses parameters during subscription:
device_type = windows
device_id = Device ID
extra_data[package] = Package ID
extra_data[channel_uri] = Channel URI
Content type
Image
Digest
Size
64.6 MB
Last updated
over 5 years ago
docker pull xfrocks/pushserver:3.2.1