Blog introduction address: Click here
It is recommended to use real machine testing. If you encounter problems, you can ask questions directly on Issues, so that everyone can see them and improve together.
Rendering display:
I have been working on IM related work for two years. Last year, I integrated the IM function of Huanxin's SDK. This year, the company has its own long-connected server, so it sets the protocol from scratch and then implements the overall function of IM step by step, basically implementing all the content related to WeChat IM. Recently, I have started to sort out some of the past knowledge, so I started with the chat framework and sorted out this simple chat framework to facilitate everyone to learn and communicate.
Since the author's computer environment is broken, cocoapods cannot be installed to manage some used three parties, so I directly imported it into this framework. Don't learn this.
The message types currently supported by this framework: text messages (including emoticons), picture messages, voice messages, video messages, file messages (pdf, word, excel, ppt, png, html, etc.).
If you want to display file messages, you need to copy the file to the /Library/Caches/Chat/File directory in the sandbox. Since I used to send files from the PC to the mobile phone for display, you can only copy them manually at present.
The videos displayed in the project have been converted to mp4 type, and have also been compressed, and the voice has also been converted to amr format. While saving traffic, it can be compatible with Android.
What can you learn from this framework:
At present, this framework is preliminary. I have many functions that have not been added. I will slowly add it in the future, including:
Update log :
October 8: Added the copy, delete and withdrawal functions of messages. Since the forwarding function requires the database to be used, I only added the forwarding UI and then improved it after adding the database.注意that only your own message can be withdrawn and the message that is successfully sent. What I restrict here is that messages within 5分钟can be withdrawn, and retraction is not allowed after the specified time.
October 12: Added system messages. When the message is withdrawn, a prompt on the chat interface that你撤回了一条消息. When multiple people chat, if one party withdraws a message, the system should send you an instruction. According to this instruction, you will identify which message was withdrawn, then delete the message, and insert a谁谁撤回了一条消息.
If you have any questions during the learning process, you can leave a message with me and everyone can improve together. If this framework can help you, welcome to star. Your attention is my greatest motivation, thank you!