xmpp-push-notifications
v1.0.12
Published
An package to customize the push notification sent by ejabberd.
Readme
Push Notifications
This plugin inserts the capability of customize the push notifications to work with ejabberd and React Native.
Install
Just run yarn add xmpp-push-notifications or npm install --save xmpp-push-notifications.
Configuration
This plugin needs no configuration.
How to use
For Node/CommonJS:
const PushNotifications = require('xmpp-push-notifications');
client.use(PushNotifications);For ES6+:
import PushNotifications from 'xmpp-push-notifications';
client.use(PushNotifications);Functions
This package adds two new functions to use, registerPush and setPushCustomFields, as described above:
client.registerPush(
token,
{
sandbox = false,
platform = 'applepush',
keepAlive = 30,
session = 60,
offline = true,
appId = 'com.netlolo.naturachat',
},
);The function accepts the following parameters in order:
- token: a string containing the user Device Token.
- options (optional) a series of optional options.
client.setPushCustomFields(
message,
'@netlolo/naturachat',
);The function accepts the following parameters in order:
- message: the original message object.
- experienceId (optional): the experienceId used by ExpoKit to detect new push notifications.
License
This plugin is MIT licensed.
