Send Android Push Notification using GCM(Google Cloud Messaging) using PHP and MySQL

As google api documentation “Google Cloud Messaging(GCM)” is service to send notifications from servers to their applications on Android devices. Using GCM service you can send notification to your application when you add/update data. Integrating GCM in your android application for enhances experience and saves lot of battery power.


Creating MySQL Database Table for store user device ids

  1. create database table for store user information and GCM Device ID.
  2. After create above table you will store user information and user device GCM id.

PHP Script For Send Push Notification :

  1. get users GCM device ids list from database.

  2. Prepare device ids and data array for send push notifications

  3. Create Gcm library file, in which file we define function to send android push notification.