Today's outsourcing project needs of a variety of perverts, to do social, tomorrow to add electricity, and the day after again live, these systems if they want to develop their own, unless the big company technology and manpower are enough, or short time is almost impossible. Therefore, learning to use the various SDKs available on the market is often an important skill.
The most recent project that continues to be done is a weather-relief app that requires instant Messaging modules for chat. has been achieved, the effect is as follows:
I. Instant Messenger SDK on the market
Currently on the market, the Instant Messaging SDK is probably: cloud, NetEase Cloud letter, Jong and so on. Very much.
More stable, more comprehensive function should be NetEase cloud letter, the interface is as follows:
But our application needs the instant communication is a module, already has Tabbar as the basic interface layout, the Chat Module tab form is more suitable, therefore facilitates the integration, uses the Jong demo.
(You can also use the SDK of cloud letters and write your own interface)
Second, the real-time communication SDK operating logic:
Generally provides the platform of the SDK, only provides the communication ability, almost does not provide the user data management . After all, if customers want to do a variety of custom requirements for personal information, the cloud platform does not provide so many custom interfaces. In addition, data security is also a factor for customers to consider, so now the cloud platform is generally only equivalent to an information transfer intermediary.
It is the operation logic, the app and the app, or the Web and app Instant messaging, the server that goes directly to the cloud platform, this server stores only UserA ID and UserB ID, and its chat content. If we want to get the chat record in the background, we get it through another interface. and the profit points of these platforms, that is, by saving chat records to charge, or to add more advanced features, such as video calls.
Third, the Instant communication module embedding
1. Binding of two sets of accounts
If you want to do the user system, then we must have their own account password. The cloud platform has a set of login VoIP account password, but does not involve specific user information management.
So we need to bind the user account and the cloud platform account one-on-one.
The operation process is simply to login with our own platform account. After landing, obtain the return account password, and then the cloud Platform communication system to log on.
2. Interface to get user information from cloud Platform account
The trouble here is that all the user data cloud platforms of the chat module are not stored , such as phones, addresses, etc. (maybe you don't want them to). So when the chat module is loaded, it only has the relationship between VoIP and VoIP. " but in general they will save the user's name (or nickname), so that when the chat module is loaded, at least the name can be loaded." "
So we have to think of the way, through VoIP, from our own database to find the user's specific information to display. such as friends, phone, etc. more detailed information, Jong are not done, need to exist in our own database and then through the interface to take out.
This piece, I realized the way is, first landing, through our server to download the user's address book (friend relationship), contacts contain friends basic information and VoIP account.
Then to get a friend's information, the local query via a VoIP account is enough. If you need more information, you can do a different interface.
Demo Download:
NetEase Cloud Letter: Http://www.netease.im/?page=download
Jong: Http://www.yuntongxun.com/api/im/sdkDemo#point_box
Integration of IOS Instant Messaging SDK to quickly build your own chat system