I am following the tutorial of GCM given here on AndroidHive . Everything is same except I am using my own Sony Xperia L instead of any emulator. I am able to register my device on my database. However, Google's API console is not showing any change after registration. Here is the screen I am getting before and after registration.
I am immediately getting a blank notification (with no data or text) on my cell just after registration. But whenever I try type and send a notification from the web interface built during the tutorial, the page gets refreshed without showing any error, but no notification arrives on my cell.
Please help me solve this problem. I want to manage push notifications based on users in my MySQL database. If any similar descriptive tutorial explains the same, it will be very much helpful to me. Thanks :)
I also faced the same problem in the beginning but then it was solved. Make sure that your computer from which u are sending the notification and the device are connected to the same wifi. Also if ur using WAMP, make sure that 'PHP Curl' is enabled.
I used my own php script to contact GCM server Instead of the interface index.php
given in tutorial.
<?php
include_once './GCM.php';
$gcm = new GCM();
$registatoin_ids = array("my_reg_id_here");
$message= "Wow! a noti!";
$message = array("price" => $message);
$result = $gcm->send_notification($registatoin_ids, $message);
echo $result;
?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.