nativescript-xmpp-client
v1.2.0
Published
XMPP websocket client plugin for Nativescript.
Downloads
2,199
Maintainers
Readme
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: '[email protected]',
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)
})