Room's last 100 messages

0 votes
Is it possible to record the last 100 or so messages posted in a room?

 

I know it'd probably be possible by setting the unique Data of the room to match the last several messages but this means there has to be a single arbiter-user doing it since every client connected should not be able to or else there will be duplicate messages written by several users.

 

Any advice on how this should be handled?
asked Aug 18, 2015 in Discuss & suggest API by bryanandhallie (16 points)

1 Answer

0 votes
 
Best answer
Hi,

For every message sender is unique. So,only sender can store the message to the cloud. This way, there will be no chance of having duplicate entry in the database.

Let me know if you have any further queries.

Thanks.
answered Aug 19, 2015 by rajeev.etc (1,660 points)
selected Aug 22, 2015 by bryanandhallie
Thanks so much! This is a good point you've made. One quick question though, do I have to use customData in the room to save this data? I'm finding it difficult to find an elegant solution if I have to constantly call getLiveRoomInfo every time I want to sync a message. This is very bandwidth intensive and there must be a better solution. Please and thank you!
If you are going to save last 100 message in the room it self then it is not recommended as each and every request has a limit of 1024 bytes of message size. The request or response should not go beyond this size. I will recommend you to save your chat history on our Storage Service of App42 Cloud API. Please go through the links mentioned below to know more about Storage Service.

App42 Getting Started: http://api.shephertz.com/tutorial/Getting-Started-Android/?index=gs-androidsdk&sdk=android

Saving AppData:http://api.shephertz.com/tutorial/Saving-App-Data/

Let me know if you face any problem.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...