Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samuelagm/nativescript-xmpp-client
An XMPP websocket client for nativescript
https://github.com/samuelagm/nativescript-xmpp-client
nativescript xmpp xmpp-websocket-client
Last synced: 3 months ago
JSON representation
An XMPP websocket client for nativescript
- Host: GitHub
- URL: https://github.com/samuelagm/nativescript-xmpp-client
- Owner: samuelagm
- License: apache-2.0
- Created: 2016-10-29T12:42:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T05:19:48.000Z (almost 2 years ago)
- Last Synced: 2024-10-15T14:20:33.623Z (3 months ago)
- Topics: nativescript, xmpp, xmpp-websocket-client
- Language: TypeScript
- Size: 1.98 MB
- Stars: 6
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nativescript-xmpp-client
## Installation
`tns install nativescript-xmpp-client`## Usage
``` ts
import {Client, IQ} from "nativescript-xmpp-client";....
const client = new Client({
websocket: {url: 'ws://127.0.0.1:5280'},
jid: '[email protected]',
password: 'secret'
});client.on('online', function (data) {
//Request roaster
client.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)
})```
## Improvements
Please feel free to send in PRs, Thanks