Jmessage无法在微信浏览器初始化

jushi_sz
2019-10-14 09:47 136 0

// 初始化 IM
imInit () {
console.log('初始化方法执行')
const JIM = new JMessage();
console.log(JIM)
this.JIM = JIM
let that = this
let imInfo = this.imInfo.authPayload
JIM.init({
"appkey": imInfo.appkey,
"random_str": imInfo.random_str,
"signature": imInfo.signature,
"timestamp": imInfo.timestamp,
"flag": 0
}).onSuccess(function (data) {
console.log('极光IM初始化成功:' + JSON.stringify(data))
let res = JSON.parse(JSON.stringify(data))
if (res.code == 0) {
that.imLogin()
} else {
let msg = '极光IM初始化失败:' + JSON.stringify(data)
that.$toast(msg)
return fasle
}
}).onFail(function (data) {
console.log('极光IM初始化失败:' + JSON.stringify(data))
});
},

在本地chrome是可以初始化成功,在微信浏览器无法执行,没有报错,onSuccess和onFail都没有执行到,
console.log(JIM) 这个是正常的

2个回答

热门排序