nativescript-xmpp
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

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

Package Sidebar

Install

npm i nativescript-xmpp

Weekly Downloads

1

Version

0.0.7

License

Apache-2.0

Unpacked Size

72.8 kB

Total Files

39

Last publish

Collaborators

  • triniwiz