I’m an android developer and currently working on GCM server side using PHP. From my client side I’m storing the gcm response token in one database, and now I want to send message to the registered users, at one go. I’m not able to figure out how to do that, and I’m totally confused. My simple HTML file is:
<html>
<head>
<title>
GCM
</title>
</head>
<body topmargin="50" leftmargin="50" CLASS = "bg">
<form action="send_message.php" name="myform" method="post">
<h4>Admin for sending notificaion to the registered user</h4>
Notification Text: <input name="appText" size="15" type="text"/><br>
URL: <input name="url" size="15" type="text" /><br>
<button type="submit">Submit</button>
</form>
</body>
</html>
And, my send_message.php:
<?php
error_reporting (0);
$link = mysql_connect("localhost","db","db");
if (!$link)
{
die(mysql_error()) ;
}
mysql_select_db("gcm_user")or die(mysql_error());
........................................
.....................................
.....................................
?>
Now, in the php file what should I do, I have tried this link Android Hive example
Just, now came through this link. Please suggest me how to use this solution for my problem. New link for my problem.
But I want only one php for my purpose. Please help in overcoming this prm.
Answering my own question. Here is what I have done to meet my requirements.
By this, I was able to send json data to the client side and get the notification.