I wonder if it’s possible to achieve chatting in mobile apps like this:
- a table with four columns: SenderID, ReceiverID, Message, Time
- when sending, app posts to a php page that adds a row
- receiver phone app continuously call another php page that loads from the table
I’m wondering if this will work in the long run? For example will it allow 100,000 people to receive the message at the sametime if I have a big enough server.
It’s possible to send and store your data like that, maybe not for 100,000 users at one time, but for many of them.
The main problem as I see it would be having potential receivers poll the server all the time. That’s a waste of server time and also client battery power. It would be better to use Google Cloud Messaging like NickT said.
The idea with GCM is that when your server gets a message, your server sends the message to Google, Google finds the recipient, and Google delivers the message to the receiver’s phone. Your app on the receiver’s phone is notified that there’s a new message.