đ Using the Demoâ
We strongly recommend running our framework-specific DEMO first. This will not only give you a hands-on experience of IMSDK's features, but also help you quickly identify and resolve issues during actual integration.
Integration Stepsâ
1. Create a Unity project and clone open-im-sdk-unity into the Assets directoryâ
2. Import Namespaceâ
using OpenIM.IMSDK.Unity;
using OpenIM.IMSDK.Unity.Listener;
3. Initializationâ
var suc = IMSDK.InitSDK(IMConfig config, IConnListener connCallBack);
4. Set Listenersâ
// Conversation listener
IMSDK.SetConversationListener(conversation);
// Friend listener
IMSDK.SetFriendShipListener(friendship);
// Group listener
IMSDK.SetGroupListener(group);
5. Loginâ
Note: Set listeners before logging in.
IMSDK.Login((suc, errCode, errMsg)=>{
}, string uid, string token, )
6. Logoutâ
IMSDK.Logout((suc, errCode, errMsg)=>{
})
7. Cleanupâ
IMSDK.UnInitSDK();