I have a message table that has a few columns such as id, to_id, from_id, is_read, etc. I’m looking for the most reliable way to check if there are any new emails and if there are, load them in with jquery and display them to the logged in user. I was thinking about using the is_read column and if its not read then pull it in but sometimes the user just wont open the message so I don’t want to pull it in again. What is the best way to check for new messages? I just want new messages to load into the inbox if the user is sitting on the inbox page.
I have a message table that has a few columns such as id ,
Share
Your API should accept either a
last_message_idor alast_checked_atparameter, and only return messages which are newer than that id/timestamp. Client side, you should ask for messages which are newer than your newest message, or the messages at the “top” of the list.