Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Advice needed for Private Messaging / Chat in an AGK app

Author
Message
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 3rd Feb 2018 13:14 Edited at: 3rd Feb 2018 13:17
Hi

Merely after advise here, not how to code it

If you wanted to add private messaging between users in your AppGameKit app (users across the world, not on the same local network) how would you store the messages? I know that the messages will need to be stored in an online database but when a new message is added to the database, and the recipient opens the app after receiving a push notification would you download the new message and store in a file on the recipients device? There might be multiple text files on the device, one for each chat history between two users.

If not a text file option how and where would you save the chat log other than the online database? I could download all messages everytime the chat window is opened and not save it on the device at all but those URL GET/POST lines could get really long and the loading of messages might slow down a bit.

I'm not after a WhatsApp type encrypted messaging service, just a simple messaging system like you'd find on most forums, and for it to go through HTTPS. It could look and feel like a chat program like WhatsApp or Messenger or it could look/feel and act more like an email app or forum private messaging. I'm not too fussed. Just want something simple.

If each chatlog was saved in a text file do you think something like this would be adequate to loop through each time the user opens the chat window

03/02/2018 12:59:34 (You): Hi, how are you doing?
03/02/2018 13:01:12 (Partner): Yeah good thanks, you?
03/02/2018 13:02:25 (You): Yeah not bad!
... and so on.

If users share private details between each other then that information would be stored openly in these text files. Would you encrypt all messages in the text file? If so what would be the best/quickest method?

Thanks

Kevin
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 3rd Feb 2018 13:53 Edited at: 3rd Feb 2018 13:55
i would store a dialog crypted in database with the possibility to delete written text at all sides from a user. (not saved forever like facebook do)
at phone i would only grab messages between a timestamp, a week or month and just hold it into memory not saved as duplicates.
that can also be a time stamp from last message until current time or last message.
if you scroll in past and you not hold this timespan in memory request it from web server.
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 3rd Feb 2018 15:27
Thanks, so every time they open the chat message thread it downloads a number of messages (or between two timestamps) and displays them. And if they scroll up to see earlier messages it gets previous messages between another two dates and displays those. Saving all of the messages in an array which will be cleared at the end of the session. So no saving to text files on the device.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 3rd Feb 2018 15:54
after start the app i would make a query on existing dialogs.
then if you click at one for continue chat you get once the messages by query from-to.
at notity i would make a query for newer messages.
the same if the user drag down in screen if something gone wrong.
if the user switch between chats i would use the messages from memory.
yes you can use list in list with dynamic arrays and hold the data in self defined types.
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 4th Feb 2018 10:11
Thanks for the advise. I'm going to start working on a mini seperate project to see if I can get this working and see what the speeds are like with sending and retrieving messages and chat history etc.

Just putting together the database schema now.

Login to post a reply

Server time is: 2024-11-24 02:59:16
Your offset time is: 2024-11-24 02:59:16