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

1.2.0 • Public • Published

An XMPP websocket client plugin for Nativescript

Installation

tns install nativescript-xmpp-client

Usage

import {Client, IQ} from "nativescript-xmpp-client";
 
....
   
       var client = new Client({
               websocket: {url: 'ws://127.0.0.1:5280'},
               jid: 'client2@127.0.0.1',
               password: 'secret'
           });
           
       client.on('online', function (data) {
           //Request roaster
           client1.send(new IQ({from: data.jid, type: 'get', id: 'rand'}).c('query', {xmlns: 'jabber:iq:roster'}));
       });
       
       client.on('stanza', function (stanza) {
           console.log(stanza.root().toString());
       });
           
       client.on('error', function (error) {
           console.log('client2', error)
       })
 

Package Sidebar

Install

npm i nativescript-xmpp-client

Weekly Downloads

517

Version

1.2.0

License

MIT

Last publish

Collaborators

  • samuelagm