【文件属性】:
文件名称:nativescript-xmpp
文件大小:2.1MB
文件格式:ZIP
更新时间:2021-05-11 11:29:40
TypeScript
本机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