nativeScript-xmpp
NativeScript XMPP 客户端
npm i --save nativescript-xmpp

npm npm Build Status

Nativescript XMPP

安装

tns plugin add nativescript-xmpp

使用方法

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();

许可证

Apache 许可证 2.0 版,2004 年 1 月