import {JmessageChenyu} from "jmessage-chenyu";
import { Platform } from 'ionic-angular';
import { NgZone } from '@angular/core';
@Component({ ... })
export class MyComponent {
constructor(private jMessageChenyu: JmessageChenyu, private platform: Platform) {
platform.ready().then(() => {
this.jMessageChenyu.init({ isOpenMessageRoaming: true })
let obj ={username: id, password: '123456'}
this.jMessageChenyu.register(obj)
.then(() => {
this.toast("注册成功,请登录!")
})
.catch((error) => {
this.toast("注册失败" + JSON.stringify(error))
});
this.jMessageChenyu.login(obj).then(
)
this.jMessageChenyu.logout().then(
)
this.jMessageChenyu.getMyInfo().then()
});
}
}