iOS implementation of MobIM

MobIM SDK is a set of SDK developed by Mob for developers to quickly obtain solutions in the field of instant messaging. It aims to provide the fastest integration method, the easiest use method and the most reliable technical service.

1. The overall architecture and functional modules of MobIM

MobIMSDK provides developers with a complete IM development framework. The overall architecture includes the following parts:

 

·  MobIMSDK_Core: The core module of the SDK, responsible for the implementation of the message synchronization protocol and data communication with the server.

·  MobIMSDK: It is a complete IM function based on the core module of the SDK, mainly for different types of message sending and receiving, as well as session management, friends, groups and other functions.

·  MobIMUI: is a set of IM-related UI controls, as long as it helps developers quickly integrate MobIMSDK.

Developers can quickly integrate with the UI, or directly face the SDK and build their own UI to call the interface provided by the SDK.

MobIMSDK adopts a modular design as a whole, and the functions of each module are relatively independent and complete. Developers can choose to use the following modules according to their own needs:

 

·  MobIM: It is the main entrance of the SDK, mainly to complete functions such as login, logout, and connection management. It is also responsible for calling other modules.

·  MIMChatManager: responsible for message sending and receiving, session management and other functions.

·  MIMContactManager: responsible for managing the functions of adding, deleting, and blacklisting friends.

·  MIMGroupManager: Responsible for group management, including creating groups, deleting groups, group members, group information management, etc.

2. MobIM SDK business process

When developing and using the SDK, you can refer to the following business flow chart to facilitate understanding and integration of the SDK.

 

1.  Client integration, start and initialize the SDK;

2. The  client builds the UI by itself and calls the SDK-related interfaces to initialize the chat state, ready to start chatting;

3.  The sent message is packaged and stored in the SDK, and then sent to the server through the core SDK, and the server forwards it;

4.  When the server forwards data, the core SDK will report the data in real time when it receives the data, and then go to the SDK layer for data packaging and storage, and return it to the developer at the same time;

3. Relevant instructions

Three important issues in the field of instant messaging, one is the communication method, which is a choice based on TCP or UDP, and the other is the data format. At present, there are many data format protocols, which can be said to have their own merits. MobIM chose to do business on the basis of the JSPP protocol. Another related optimization is data storage. In the iOS client of MobIM, CoreData of the iOS system is selected as the data storage tool.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325443009&siteId=291194637