示例#1
0
        /// <summary>
        /// 登陆聊天室
        /// </summary>
        /// <param name="roomId">聊天室ID</param>
        /// <param name="request">聊天室登录信息(NIM SDK请求聊天室返回的数据)</param>
        /// <param name="loginData">聊天室可选信息</param>
        public static void Login(long roomId, string request, LoginData loginData = null)
        {
            string loginJson = string.Empty;

            if (loginData != null)
            {
                loginJson = loginData.Serialize();
            }
            ChatRoomNativeMethods.nim_chatroom_enter(roomId, request, loginJson, string.Empty);
        }
示例#2
0
        public static void LoginWithAnonymous(long roomId, AnonymousInfo anonymityInfo, LoginData loginData = null)
        {
            string loginJson = string.Empty;

            if (loginData != null)
            {
                loginJson = loginData.Serialize();
            }

            if (anonymityInfo == null)
            {
                return;
            }

            string anonymity_info = anonymityInfo.Serialize();

            ChatRoomNativeMethods.nim_chatroom_enter_with_anoymity(roomId, anonymity_info, loginJson, null);
        }