He there!
If have a question that is related to two different issues I currently have in an application I'm working on.
Issue 1: - There is a message system. Users are able to send each other messages. I would like to have a real time pop up when the user gets a new message and is not on the inbox page.
Issue 2: - I would like to create a basic achievement system, one of the achievements could (for example) be: "Receive a message."
Now I think both functionalities can be achieved through the same way. Anyone of you has any experience with this type of real time communication? I really have no idea where to start. I would really love it if it is not to heavy.
Thanks a lot.
Here's a boilerplate you might use for long polling (using jQuery and Yii):
Server-side:
Client-side:
Remember to implement some kind of authentication to avoid users reading each others messages.