mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
parent
8d26ca1a90
commit
241a26436a
2 changed files with 11 additions and 5 deletions
|
|
@ -54,12 +54,17 @@ class APNs extends Base implements \Rhymix\Framework\Drivers\PushInterface
|
|||
// Set parameters
|
||||
$local_cert = $this->_config['certificate'];
|
||||
$passphrase = $this->_config['passphrase'];
|
||||
$alert = [];
|
||||
$alert['title'] = $message->getSubject();
|
||||
$alert['body'] = $message->getContent();
|
||||
$metadata = $message->getMetadata();
|
||||
|
||||
$body['aps'] = array('alert' => $alert);
|
||||
$payload = json_encode($body);
|
||||
$payload = json_encode([
|
||||
'aps' => [
|
||||
'alert' => [
|
||||
'title' => $message->getSubject(),
|
||||
'body' => $message->getContent(),
|
||||
],
|
||||
'sound' => isset($metadata['sound']) ? $metadata['sound'] : 'default',
|
||||
],
|
||||
]);
|
||||
|
||||
foreach($tokens as $token)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ class FCM extends Base implements \Rhymix\Framework\Drivers\PushInterface
|
|||
$notification = $message->getMetadata();
|
||||
$notification['title'] = $message->getSubject();
|
||||
$notification['body'] = $message->getContent();
|
||||
$notification['sound'] = isset($notification['sound']) ? $notification['sound'] : 'default';
|
||||
|
||||
$chunked_token = array_chunk($tokens, 1000);
|
||||
foreach($chunked_token as $token_unit)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue