0.0.42 • Published 3 years ago
imsdkwebtest v0.0.42
Tmmtmm SDK
Initialize SDK
const sdk = IMSdk.getInstance('你的ak', IMEnvironmentType.alpha);
sdk.setDelegate({
authCodeExpire(auid) {
if (constants.authcode.length > 0) {
sdk.setAuthCode(constants.authcode);
return;
}
onGetAuth().then(() => {
sdk.setAuthCode(constants.authcode);
});
},
onShowUserInfo(auids) {
const infos: UserInfo[] = [];
sdk.setUserInfo(infos);
},
});
Init User
sdk.initUser(auid)
Create Chat
sdk.createChat({
gid: '会话Id',
auids: ['用户Id'],
chatName: '会话名',
delegate: {
onSucc: () => {
console.log('create chat success');
},
onError: res => {
console.log(res);
},
},
});
Send Text Message
sdk.sendTextMessage({
gid, //会话Id
amid, //消息Id
content //文本内容
})
Send Image Message
sdk.sendImageMessage({
gid, //会话Id
amid, //消息Id
data //图片blob文件
})
Send Attachment Message
sdk.sendAttachmentMessage({
gid, //会话Id
amid, //消息Id
data //附件blob文件
})
0.0.40
3 years ago
0.0.41
3 years ago
0.0.30
3 years ago
0.0.42
3 years ago
0.0.31
3 years ago
0.0.32
3 years ago
0.0.33
3 years ago
0.0.34
3 years ago
0.0.35
3 years ago
0.0.36
3 years ago
0.0.37
3 years ago
0.0.26
3 years ago
0.0.38
3 years ago
0.0.27
3 years ago
0.0.39
3 years ago
0.0.28
3 years ago
0.0.29
3 years ago
0.0.23
3 years ago
0.0.24
3 years ago
0.0.25
3 years ago
0.0.22
3 years ago