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 ;Setting Android
android[url] = "https://android.googleapis.com/gcm/send" android[url] = "https://fcm.googleapis.com/fcm/send"
android[serverApiKey] = "AIzaSyALwyLUYtZDcJQr54V5rxhZjoWnOLWCSvc" android[serverApiKey] = "AAAAMvip2iU:APA91bHFAvHmCsSh0zbRaC9Xo2EPIbbRYzehkFAKUdXmj_ZVBOOO52npae183LYUONHjNPHaKo1MqT4BWiEuTF7HVEMfwn05XOA-h1LQ_bJ0ezAA35l-wADPq5VtKDiHT1VFGW1oeU7L"
;Setting Apple ;Setting Apple
apple[url] = "ssl://gateway.push.apple.com:2195" apple[url] = "ssl://gateway.push.apple.com:2195"

View File

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