/// <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; }
/// <summary> /// 初始化聊天实模块 /// </summary> public static void Init() { ChatRoomNativeMethods.nim_chatroom_init(null); RegisterLoginCallback(); RegisterExitChatRoomCallback(); RegisterLinkStateChangedCallback(); RegisterReceiveMsgCallback(); RegisterReceiveNotificationMsgCallback(); RegisterSendMsgArcCallback(); }
/// <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; }
/// <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; }