This commit is contained in:
Paula Quispe
2019-05-07 13:54:58 -04:00
parent 476b51d54a
commit d3f1516f14
2 changed files with 16 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
;Setting Android
android[url] = "https://android.googleapis.com/gcm/send"
android[serverApiKey] = "AIzaSyALwyLUYtZDcJQr54V5rxhZjoWnOLWCSvc"
android[url] = "https://fcm.googleapis.com/fcm/send"
android[serverApiKey] = "AAAAMvip2iU:APA91bHFAvHmCsSh0zbRaC9Xo2EPIbbRYzehkFAKUdXmj_ZVBOOO52npae183LYUONHjNPHaKo1MqT4BWiEuTF7HVEMfwn05XOA-h1LQ_bJ0ezAA35l-wADPq5VtKDiHT1VFGW1oeU7L"
;Setting Apple
apple[url] = "ssl://gateway.push.apple.com:2195"

View File

@@ -17,9 +17,9 @@ use ProcessMaker\Core\System;
class PushMessageAndroid
{
private $url = 'https://android.googleapis.com/gcm/send';
private $serverApiKey = "AIzaSyBO-VLXGhjf0PPlwmPFTPQEKIBfVDydLAk";
private $devices = array();
private $url = 'https://fcm.googleapis.com/fcm/send';
private $serverApiKey = "AAAAMvip2iU:APA91bHFAvHmCsSh0zbRaC9Xo2EPIbbRYzehkFAKUdXmj_ZVBOOO52npae183LYUONHjNPHaKo1MqT4BWiEuTF7HVEMfwn05XOA-h1LQ_bJ0ezAA35l-wADPq5VtKDiHT1VFGW1oeU7L";
private $devices = [];
private $numberDevices = 0;
/**
@@ -78,24 +78,24 @@ class PushMessageAndroid
}
if (!is_null($data)) {
$fields = array(
$fields = [
'registration_ids' => $this->devices,
'data' => array(
"message" => $message,
"data" => $data
),
);
'notification' => [
"body" => $message,
"data" => $data,
],
];
} else {
$fields = array(
$fields = [
'registration_ids' => $this->devices,
'data' => array("message" => $message),
);
'data' => ["message" => $message],
];
}
$headers = array(
$headers = [
'Authorization: key=' . $this->serverApiKey,
'Content-Type: application/json'
);
];
// Open connection
$ch = curl_init();