8 changed files with 98 additions and 4 deletions
-
1CHANGELOG.md
-
1app/Configuration.php
-
8app/helpers/UtilsHelper.php
-
26app/widgets/AdminMain/adminmain.tpl
-
6app/widgets/AdminMain/locales.ini
-
21app/widgets/Notification/Notification.php
-
7app/widgets/Presence/Presence.php
-
32src/Movim/Firebase.php
@ -0,0 +1,32 @@ |
|||
<?php |
|||
|
|||
namespace Movim; |
|||
|
|||
class Firebase |
|||
{ |
|||
private $_key; |
|||
private $_token; |
|||
|
|||
public function __construct(string $key, string $token) |
|||
{ |
|||
$this->_key = $key; |
|||
$this->_token = $token; |
|||
} |
|||
|
|||
public function notify(string $title, string $body = null, string $image = null, string $action = null) |
|||
{ |
|||
$headers = ['Authorization:key='.$this->_key,'Content-Type:application/json']; |
|||
|
|||
$fields = [ |
|||
'to' => $this->_token, |
|||
'data' => [ |
|||
'title' => $title, |
|||
'body' => $body, |
|||
'image' => $image, |
|||
'action' => $action |
|||
] |
|||
]; |
|||
|
|||
var_dump(requestURL('https://fcm.googleapis.com/fcm/send', 10, json_encode($fields), true, $headers)); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue