Sent PUSH notification (requared: PUSH notification module)
$query = db_select('push_notifications_tokens', 'pnt');
$query->fields('pnt', array('token'));
$query->condition('pnt.uid', 9148);
$result = $query->execute()->fetchAll();
dsm($result);
if (!empty($result)) {
foreach ($result as $token) {
$payload['alert'] = "{\"header\":\"Silk Paints\",\"message\":\"SILK TEST\"}";
$token_sent = array(
0 => $token->token
);
$result = push_notifications_gcm_send_message($token_sent, $payload);
dsm($result);
}
}