TIMSetKickedOfflineCallback
Introduction
Set user kicked offline callback
Once an account is logged on other platform, the previous login is nullified. And the previous platform will receive this callback. (You may force the previous one exit the APP or rekick)
If kicked offline when offline, then the next login will fail and you may give an emphasized error (Error codeERR_IMSDK_KICKED_BY_OTHERS: 6208) or just ignore it
Online user inter-kick situation:
Logged on Device1, then log on Device2, Device1 will get TIMSetKickedOfflineCallback
After receiving the callback, you may allow Device1 to login and force Device2 offline.
Offline user inter-kick situation:
Logged on Device1, go offline without logged out. And you logged on Device2, no callbacks
When Device1 relogged in, it will receive Error codeERR_IMSDK_KICKED_BY_OTHERS: 6208 to inform it's kicked by another one.
If needed, Device1 login again, and Device2 will receive TIMSetKickedOfflineCallback
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
params | TIMSetKickedOfflineCallbackParam | yes | Param of setting user kicked offline callback |
Returned template
void
Return value details
This function has no return value
Code example
import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
import { TIMSetKickedOfflineCallbackParam } from "im_electron_sdk/dist/interfaces";
let param: TIMSetKickedOfflineCallbackParam = {
userData: "", // required
callback: (data) => { } // required
};
timRenderInstance.TIMSetKickedOfflineCallback(param)