예제 #1
0
        /// <summary>
        /// 初始化聊天实模块
        /// </summary>
        public static void Init(NIMChatRoomConfig config = null)
        {
            if (_chatRoomInitialized)
            {
                return;
            }
            try
            {
                string json = config != null?config.Serialize() : "";

                ChatRoomNativeMethods.nim_chatroom_init(json);
                RegisterLoginCallback();
                RegisterExitChatRoomCallback();
                RegisterLinkStateChangedCallback();
                RegisterReceiveMsgCallback();
                RegisterReceiveNotificationMsgCallback();
                RegisterSendMsgArcCallback();
            }
            catch (Exception e)
            {
                _chatRoomInitialized = false;
                System.Diagnostics.Debug.WriteLine(e.ToString());
            }
            _chatRoomInitialized = true;
        }
예제 #2
0
 /// <summary>
 /// 初始化聊天实模块
 /// </summary>
 public static void Init()
 {
     ChatRoomNativeMethods.nim_chatroom_init(null);
     RegisterLoginCallback();
     RegisterExitChatRoomCallback();
     RegisterLinkStateChangedCallback();
     RegisterReceiveMsgCallback();
     RegisterReceiveNotificationMsgCallback();
     RegisterSendMsgArcCallback();
 }
예제 #3
0
 /// <summary>
 /// 初始化聊天实模块
 /// </summary>
 public static void Init()
 {
     if (_chatRoomInitialized)
     {
         return;
     }
     try
     {
         ChatRoomNativeMethods.nim_chatroom_init("");
         RegisterLoginCallback();
         RegisterExitChatRoomCallback();
         RegisterLinkStateChangedCallback();
         RegisterReceiveMsgCallback();
         RegisterReceiveNotificationMsgCallback();
         RegisterSendMsgArcCallback();
     }
     catch (Exception e)
     {
         _chatRoomInitialized = false;
         System.Diagnostics.Debug.WriteLine(e.ToString());
     }
     _chatRoomInitialized = true;
 }
예제 #4
0
 /// <summary>
 /// 初始化聊天实模块
 /// </summary>
 public static void Init()
 {
     if (_chatRoomInitialized)
     {
         return;
     }
     try
     {
         ChatRoomNativeMethods.nim_chatroom_init(null);
         RegisterLoginCallback();
         RegisterExitChatRoomCallback();
         RegisterLinkStateChangedCallback();
         RegisterReceiveMsgCallback();
         RegisterReceiveNotificationMsgCallback();
         RegisterSendMsgArcCallback();
     }
     catch (Exception e)
     {
         _chatRoomInitialized = false;
         NimUtility.Log.Error(e.Message);
     }
     _chatRoomInitialized = true;
 }