Projects integrated with TUIKit provide a group livestreaming entry by default.
If the Tencent Real-Time Communication (TRTC) service is not activated, enable group livestreaming as follows:
Note:
A TRTC application with the same SDKAppID as the IM application is created in the TRTC console. You can use the same account and authentication information for IM and TRTC.
To initialize TUIKit, import the SDKAppID generated in Step 1. (If your project has already integrated with TUIKit, skip this step.)
TUIKit.init(Context, SDKAppID, new ConfigHelper().getConfigs());
Call the login
API provided by TUIKit to log in to IM. For more information on how to generate UserSig, see UserSig. (If your application is integrated with TUIKit, skip this step.)
TUIKit.login("userId", "userSig", new IUIKitCallBack() {
@Override
public void onError(String module, final int code, final String desc) {
Log.i(TAG, "onError: login failed");
}
@Override
public void onSuccess(Object data) {
Log.i(TAG, "onSuccess: login successful");
}
});
In TUIKitLive, group livestreaming is enabled by default. If you do not need group livestreaming, disable the group livestreaming entry through TUIKit configuration. The code is as follows:
// enableGroupLiveEntry true: enable; false: disable; default value: true
TUIKit.getConfigs().setEnableGroupLiveEntry(enableGroupLiveEntry)
Was this page helpful?