nativescript-xmpp
by triniwiz | v0.0.7
NativeScript XMPP Client
npm i --save nativescript-xmpp

npm npm Build Status

Nativescript XMPP

Installation

tns plugin add nativescript-xmpp

Usage

import { isIOS } from 'tns-core-modules/platform';
import { XMPP, Presence } from 'nativescript-xmpp';
const xmpp = new XMPP({
username: 'user',
password: 'password',
domain: 'localhost',
host: isIOS ? 'localhost' : '10.0.2.2'
});
xmpp.on('connected', args => {
xmpp.login();
});
xmpp.on('authenticated', (args: any) => {
const presence = new Presence();
presence.status = 'Nice';
xmpp.send(presence);
});
xmpp.connect();

License

Apache License Version 2.0, January 2004