Push Notification for android PHP script not working?
I have developed the android application for Android. And also i developed a PHP script for send the notification to mobile device.
T开发者_StackOverflow中文版he script is running successfully and send message but my android device doesn't receive the notification.
Please any one help me to send the notification to my device
You need to check on the server what HTTP response you are getting from the Google servers. Make sure it is a 200 OK response, so you know the message was sent. If you get another response (302, etc) then the message is not being sent successfully.
You also need to check that the Registration ID you are using is correct. If you provide the wrong Registration ID (as a destination for the message - specifying the app, on a specific device) then the Google servers cannot successfully send it.
You also need to check that your app is successfully registering with the Google servers, to receive push notifications. If the registration fails, you will not receive messages.
This tutorial provides a lot of clarity about C2DM, and include sample code. http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html
精彩评论