2

I'm wondering how can I make notification on my website when Android post data. For example : The website have index.php and post.php.
Then, I use POST request to send data to website(through post.php) from Android. At this time I would like to show notification to all user who is being index.php.
How can I do that ?

1
  • You can add one parameter to your POST set that says, "cameFromAndroid=true". Or something... Commented Mar 7, 2016 at 18:12

2 Answers 2

1

You're asking for a backend (POSTing data to the server) that will update the current front end (index.php presentation) for multiple users.

I'm assuming here you've already got an API sorted for communicating to the back end on your post.php - something that allows you to pass an update. So lets address index.php:

You'll need to use Websockets to inform clients of an update. A popular solution for this is Ratchet and it's commonly used to write chat clients that need to receive and send information from clients.

Sign up to request clarification or add additional context in comments.

Comments

1

I completed agree with @Liam Martin Websockets is a good approach for this case, another solution could be, in your index.php you could create ajax request that keep checking if there is a new post from a android devices.

OR

You could give a try to https://www.firebase.com/ is very handy, when you want to real develop time app.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.