SDKAppID
.SdkConfig
.Init
to initialize the SDK.SDKAppID
.
SDKAppID
is the unique ID that the IM service uses to identify a customer account. We recommend you apply for a new SDKAppID
for every independent app to automatically isolate messages between SDKAppIDs
.
You can view all SDKAppIDs
in the IM console or click Create Application to create an SDKAppID
.namespace Com.Tencent.IM.Unity.UIKit{public static void Init() {string sdkappid = ""; // Get the `SDKAppID` from the IM consoleSdkConfig sdkConfig = new SdkConfig();sdkConfig.sdk_config_config_file_path = Application.persistentDataPath + "/TIM-Config";sdkConfig.sdk_config_log_file_path = Application.persistentDataPath + "/TIM-Log";TIMResult res = TencentIMSDK.Init(long.Parse(sdkappid), sdkConfig);}}
NetworkStatusListenerCallback
, UserSigExpiredCallback
, and other callbacks.
We recommend you register a global event listener immediately after calling initSDK
and perform logic processing in such callbacks.Event Callback | Description |
Callback for receiving a new message | |
Callback for a message read receipt | |
Callback for a message recall | |
Callback for the upload progress of a message element | |
Callback for a group system message | |
Callback for a group attribute change | |
Callback for a change in the unread message count of a conversation | |
Callback for listening for the network connection status | |
Callback for being kicked offline | |
Callback for ticket expiration | |
Callback for adding a friend | |
Callback for deleting a friend | |
Callback for updating the profile of a friend | |
Callback for a friend request | |
Callback for deleting a friend request | |
Callback for reading a friend request | |
Callback for adding a friend to the blocklist | |
Callback for deleting a friend from the blocklist | |
Log callback | |
Callback for a message update | |
Callback for getting the list of group members who have read a group message |
UserSigExpiredCallback
callback, the UserSig
that you use for login has expired. In this case, you need to use the newly issued UserSig
to log in again. If you continue to use the expired UserSig
, the IM SDK will enter an infinite login loop.// Uninitialize the SDKTencentIMSDK.Uninit();
res
is TIMResult.TIM_SUCC = 0
, the API call is successful.
Was this page helpful?