$args = http_build_query(array(
'certPassword' => 'CERTIFICATE_PASSWORD',
'cert' => 'LINK_TO_YOUR_P12_FILE',
'production' => false,
'device' => $device['deviceId'],
'packageName' => 'YOUR_APP_PACKAGE_HERE',
'email' => 'YOUR_EMAIL_ADDRESS_HERE',
'type' => 1,
'auth' => 'YOUR_GOOGLE_AUTH_KEY',
'body' => $wstext));
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $args
)
);
$context = stream_context_create($opts); $response = file_get_contents("https://codename-one.appspot.com/sendPushMessage", false, $context);