To use the cloud for instant messaging, here are the steps to implement:
1, Registered Appkey secret, this is the first step;
2, download cloud Java client Https://github.com/rongcloud/server-sdk-java;
3, integrated into their own projects. This is the download, the directory is very simple
We took two bags to our project and two jars into our own project LIB, so we can do it.
4. Since our business is only for a single chat and one-to-two business, the client can only implement these features:
1. Get token
2 messages, I see that the cloud provides real-time routing, and Message history, feel no use, because the message is called the client, so when the message is sent to our current database, when the user clicks into the chat, will be instant access to chat with us, look at my database design
A table is used to store the message:
USER_ID is sender, be_user_id, addressee, contentId, session record ID, two person only one session record, generate policy:
is to judge the size of the small put in front (this is because our business needs), content, whether unread read.
3, Send message:
Basically has realized the function.
Of course
Java-side implementation of cloud-melting