no message
This commit is contained in:
		
							parent
							
								
									b7c04d16b3
								
							
						
					
					
						commit
						1af1ecfbb9
					
				| @ -30,6 +30,9 @@ class _MyAppState extends State<MyApp> { | |||||||
|             listener: OnConnectListener()) |             listener: OnConnectListener()) | ||||||
|         .then((value) { |         .then((value) { | ||||||
|       print('SDK initialized successfully'); |       print('SDK initialized successfully'); | ||||||
|  | 
 | ||||||
|  |       OpenIM.iMManager.userManager.setUserListener(OnUserListener()); | ||||||
|  | 
 | ||||||
|       OpenIM.iMManager |       OpenIM.iMManager | ||||||
|           .login( |           .login( | ||||||
|               userID: "3e8b8fb2ecd8414db50838d9f7bcb19d", |               userID: "3e8b8fb2ecd8414db50838d9f7bcb19d", | ||||||
|  | |||||||
| @ -12,10 +12,10 @@ class ChannelManagerService : public FLTService | |||||||
| public: | public: | ||||||
| 	ChannelManagerService(); | 	ChannelManagerService(); | ||||||
| 
 | 
 | ||||||
|         void onMethodCalled( | 	virtual void onMethodCalled( | ||||||
|             const std::string &method, | 		const std::string& method, const flutter::EncodableMap* arguments, | ||||||
|             const flutter::EncodableMap *arguments, | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) | ||||||
|             std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		override; | ||||||
| 
 | 
 | ||||||
| 	// Method handlers
 | 	// Method handlers
 | ||||||
| 	void setChannelListener( | 	void setChannelListener( | ||||||
| @ -49,8 +49,7 @@ class ChannelManagerService : public FLTService | |||||||
| 		const flutter::EncodableMap* arguments, | 		const flutter::EncodableMap* arguments, | ||||||
| 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | ||||||
| 
 | 
 | ||||||
|     private: | 
 | ||||||
|         std::string m_serviceName; |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif // CHANNEL_MANAGER_SERVICE_H
 | #endif // CHANNEL_MANAGER_SERVICE_H
 | ||||||
| @ -11,10 +11,10 @@ public: | |||||||
| 	ConversationManagerService(); | 	ConversationManagerService(); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   void onMethodCalled( | 	virtual void onMethodCalled( | ||||||
|       const std::string& method, | 		const std::string& method, const flutter::EncodableMap* arguments, | ||||||
|       const flutter::EncodableMap* arguments, | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) | ||||||
|       std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		override; | ||||||
| 
 | 
 | ||||||
| 	// Method handlers
 | 	// Method handlers
 | ||||||
| 	void setConversationListener( | 	void setConversationListener( | ||||||
| @ -75,8 +75,7 @@ public: | |||||||
| 		const flutter::EncodableMap* arguments, | 		const flutter::EncodableMap* arguments, | ||||||
| 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | ||||||
| 
 | 
 | ||||||
| private: | 
 | ||||||
|   std::string m_serviceName; |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif // CONVERSATION_MANAGER_SERVICE_H
 | #endif // CONVERSATION_MANAGER_SERVICE_H
 | ||||||
| @ -12,10 +12,10 @@ class FriendshipManagerService : public FLTService | |||||||
| public: | public: | ||||||
| 	FriendshipManagerService(); | 	FriendshipManagerService(); | ||||||
| 
 | 
 | ||||||
|     void onMethodCalled( | 	virtual void onMethodCalled( | ||||||
|         const std::string &method, | 		const std::string& method, const flutter::EncodableMap* arguments, | ||||||
|         const flutter::EncodableMap *arguments, | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) | ||||||
|         std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		override; | ||||||
| 
 | 
 | ||||||
| 	// Method handlers
 | 	// Method handlers
 | ||||||
| 	void setFriendListener( | 	void setFriendListener( | ||||||
| @ -67,8 +67,6 @@ public: | |||||||
| 		const flutter::EncodableMap* arguments, | 		const flutter::EncodableMap* arguments, | ||||||
| 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | ||||||
| 
 | 
 | ||||||
| private: |  | ||||||
|     std::string m_serviceName; |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif // FRIENDSHIP_MANAGER_SERVICE_H
 | #endif // FRIENDSHIP_MANAGER_SERVICE_H
 | ||||||
| @ -12,10 +12,10 @@ class GroupManagerService : public FLTService | |||||||
| public: | public: | ||||||
| 	GroupManagerService(); | 	GroupManagerService(); | ||||||
| 
 | 
 | ||||||
|     void onMethodCalled( | 	virtual void onMethodCalled( | ||||||
|         const std::string &method, | 		const std::string& method, const flutter::EncodableMap* arguments, | ||||||
|         const flutter::EncodableMap *arguments, | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) | ||||||
|         std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		override; | ||||||
| 
 | 
 | ||||||
| 	// Method handlers
 | 	// Method handlers
 | ||||||
| 	void setGroupListener( | 	void setGroupListener( | ||||||
| @ -100,8 +100,7 @@ public: | |||||||
| 		const flutter::EncodableMap* arguments, | 		const flutter::EncodableMap* arguments, | ||||||
| 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | ||||||
| 
 | 
 | ||||||
| private: | 
 | ||||||
|     std::string m_serviceName; |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif // GROUP_MANAGER_SERVICE_H
 | #endif // GROUP_MANAGER_SERVICE_H
 | ||||||
| @ -10,10 +10,10 @@ class MessageManagerService : public FLTService { | |||||||
| public: | public: | ||||||
| 	MessageManagerService(); | 	MessageManagerService(); | ||||||
| 
 | 
 | ||||||
|   void onMethodCalled( | 	virtual void onMethodCalled( | ||||||
|       const std::string& method, | 		const std::string& method, const flutter::EncodableMap* arguments, | ||||||
|       const flutter::EncodableMap* arguments, | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) | ||||||
|       std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		override; | ||||||
| 
 | 
 | ||||||
| 	// Method handlers
 | 	// Method handlers
 | ||||||
| 	void setAdvancedMsgListener( | 	void setAdvancedMsgListener( | ||||||
| @ -152,8 +152,7 @@ public: | |||||||
| 		const flutter::EncodableMap* arguments, | 		const flutter::EncodableMap* arguments, | ||||||
| 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | ||||||
| 
 | 
 | ||||||
| private: | 
 | ||||||
|   std::string m_serviceName; |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif // MESSAGE_MANAGER_SERVICE_H
 | #endif // MESSAGE_MANAGER_SERVICE_H
 | ||||||
| @ -15,21 +15,29 @@ void UserManagerService::onMethodCalled( | |||||||
| 	std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) { | 	std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) { | ||||||
| 	if (method == "setUserListener") { | 	if (method == "setUserListener") { | ||||||
| 		setUserListener(arguments, result); | 		setUserListener(arguments, result); | ||||||
|     } else if (method == "getUsersInfo") { | 	} | ||||||
|  | 	else if (method == "getUsersInfo") { | ||||||
| 		getUsersInfo(arguments, result); | 		getUsersInfo(arguments, result); | ||||||
|     } else if (method == "setSelfInfo") { | 	} | ||||||
|  | 	else if (method == "setSelfInfo") { | ||||||
| 		setSelfInfo(arguments, result); | 		setSelfInfo(arguments, result); | ||||||
|     } else if (method == "getSelfUserInfo") { | 	} | ||||||
|  | 	else if (method == "getSelfUserInfo") { | ||||||
| 		getSelfUserInfo(arguments, result); | 		getSelfUserInfo(arguments, result); | ||||||
|     } else if (method == "subscribeUsersStatus") { | 	} | ||||||
|  | 	else if (method == "subscribeUsersStatus") { | ||||||
| 		subscribeUsersStatus(arguments, result); | 		subscribeUsersStatus(arguments, result); | ||||||
|     } else if (method == "unsubscribeUsersStatus") { | 	} | ||||||
|  | 	else if (method == "unsubscribeUsersStatus") { | ||||||
| 		unsubscribeUsersStatus(arguments, result); | 		unsubscribeUsersStatus(arguments, result); | ||||||
|     } else if (method == "getSubscribeUsersStatus") { | 	} | ||||||
|  | 	else if (method == "getSubscribeUsersStatus") { | ||||||
| 		getSubscribeUsersStatus(arguments, result); | 		getSubscribeUsersStatus(arguments, result); | ||||||
|     } else if (method == "getUserStatus") { | 	} | ||||||
|  | 	else if (method == "getUserStatus") { | ||||||
| 		getUserStatus(arguments, result); | 		getUserStatus(arguments, result); | ||||||
|     } else { | 	} | ||||||
|  | 	else { | ||||||
| 		result->NotImplemented(); | 		result->NotImplemented(); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @ -40,7 +48,8 @@ void UserManagerService::setUserListener( | |||||||
| 	if (arguments) { | 	if (arguments) { | ||||||
| 		set_user_listener(NewUserListenCallBack()); | 		set_user_listener(NewUserListenCallBack()); | ||||||
| 		result->Success(flutter::EncodableValue()); | 		result->Success(flutter::EncodableValue()); | ||||||
|     } else { | 	} | ||||||
|  | 	else { | ||||||
| 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @ -55,7 +64,8 @@ void UserManagerService::getUsersInfo( | |||||||
| 		char* userIDList_cs = const_cast<char*>(userIDList.c_str()); | 		char* userIDList_cs = const_cast<char*>(userIDList.c_str()); | ||||||
| 
 | 
 | ||||||
| 		get_users_info(NewBaseCallBack(result), operationID_cs, userIDList_cs); | 		get_users_info(NewBaseCallBack(result), operationID_cs, userIDList_cs); | ||||||
|     } else { | 	} | ||||||
|  | 	else { | ||||||
| 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @ -70,7 +80,8 @@ void UserManagerService::setSelfInfo( | |||||||
| 		char* userInfo_cs = const_cast<char*>(userInfo.c_str()); | 		char* userInfo_cs = const_cast<char*>(userInfo.c_str()); | ||||||
| 
 | 
 | ||||||
| 		set_self_info(NewBaseCallBack(result), operationID_cs, userInfo_cs); | 		set_self_info(NewBaseCallBack(result), operationID_cs, userInfo_cs); | ||||||
|     } else { | 	} | ||||||
|  | 	else { | ||||||
| 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @ -83,7 +94,8 @@ void UserManagerService::getSelfUserInfo( | |||||||
| 		char* operationID_cs = const_cast<char*>(operationID.c_str()); | 		char* operationID_cs = const_cast<char*>(operationID.c_str()); | ||||||
| 
 | 
 | ||||||
| 		get_self_user_info(NewBaseCallBack(result), operationID_cs); | 		get_self_user_info(NewBaseCallBack(result), operationID_cs); | ||||||
|     } else { | 	} | ||||||
|  | 	else { | ||||||
| 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @ -98,7 +110,8 @@ void UserManagerService::subscribeUsersStatus( | |||||||
| 		char* userIDs_cs = const_cast<char*>(userIDs.c_str()); | 		char* userIDs_cs = const_cast<char*>(userIDs.c_str()); | ||||||
| 
 | 
 | ||||||
| 		subscribe_users_status(NewBaseCallBack(result), operationID_cs, userIDs_cs); | 		subscribe_users_status(NewBaseCallBack(result), operationID_cs, userIDs_cs); | ||||||
|     } else { | 	} | ||||||
|  | 	else { | ||||||
| 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @ -113,7 +126,8 @@ void UserManagerService::unsubscribeUsersStatus( | |||||||
| 		char* userIDs_cs = const_cast<char*>(userIDs.c_str()); | 		char* userIDs_cs = const_cast<char*>(userIDs.c_str()); | ||||||
| 
 | 
 | ||||||
| 		unsubscribe_users_status(NewBaseCallBack(result), operationID_cs, userIDs_cs); | 		unsubscribe_users_status(NewBaseCallBack(result), operationID_cs, userIDs_cs); | ||||||
|     } else { | 	} | ||||||
|  | 	else { | ||||||
| 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @ -126,7 +140,8 @@ void UserManagerService::getSubscribeUsersStatus( | |||||||
| 		char* operationID_cs = const_cast<char*>(operationID.c_str()); | 		char* operationID_cs = const_cast<char*>(operationID.c_str()); | ||||||
| 
 | 
 | ||||||
| 		get_subscribe_users_status(NewBaseCallBack(result), operationID_cs); | 		get_subscribe_users_status(NewBaseCallBack(result), operationID_cs); | ||||||
|     } else { | 	} | ||||||
|  | 	else { | ||||||
| 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @ -141,7 +156,8 @@ void UserManagerService::getUserStatus( | |||||||
| 		char* userIDs_cs = const_cast<char*>(userIDs.c_str()); | 		char* userIDs_cs = const_cast<char*>(userIDs.c_str()); | ||||||
| 
 | 
 | ||||||
| 		get_user_status(NewBaseCallBack(result), operationID_cs, userIDs_cs); | 		get_user_status(NewBaseCallBack(result), operationID_cs, userIDs_cs); | ||||||
|     } else { | 	} | ||||||
|  | 	else { | ||||||
| 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | 		result->Error("INVALID_ARGUMENT", "Arguments cannot be null"); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | |||||||
| @ -11,10 +11,10 @@ class UserManagerService : public FLTService { | |||||||
| public: | public: | ||||||
| 	UserManagerService(); | 	UserManagerService(); | ||||||
| 
 | 
 | ||||||
|   void onMethodCalled( | 	virtual void onMethodCalled( | ||||||
|       const std::string& method, | 		const std::string& method, const flutter::EncodableMap* arguments, | ||||||
|       const flutter::EncodableMap* arguments, | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result) | ||||||
|       std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		override; | ||||||
| 
 | 
 | ||||||
| 	// Method handlers
 | 	// Method handlers
 | ||||||
| 	void setUserListener( | 	void setUserListener( | ||||||
| @ -42,8 +42,7 @@ public: | |||||||
| 		const flutter::EncodableMap* arguments, | 		const flutter::EncodableMap* arguments, | ||||||
| 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | 		std::shared_ptr<flutter::MethodResult<flutter::EncodableValue>> result); | ||||||
| 
 | 
 | ||||||
| private: | 
 | ||||||
|   std::string m_serviceName; |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif // USER_MANAGER_SERVICE_H
 | #endif // USER_MANAGER_SERVICE_H
 | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user