Skip to content

Instantly share code, notes, and snippets.

@praserocking
Last active August 29, 2015 13:56
Show Gist options
  • Save praserocking/8894746 to your computer and use it in GitHub Desktop.
Save praserocking/8894746 to your computer and use it in GitHub Desktop.
<?php
$gcm= new GCMUtility('<your api key>');
$gcm->set_time_to_live(<seconds>); //*** optional parameter : int
$gcm->set_restricted_package_name(<restricted package name>); //*** optional parameter: string
$gcm->set_device_ids(<device IDs given by GCM>); // mandatory parameter: either array of strings or a string
$gcm->set_message(<message to be sent>); // mandatory parameter: either a string or array of string with string keys ;example: array("number":"345");
if($gcm->send())echo "Message Sent";
else echo "Message Sending not Successful";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment