Created
March 27, 2020 12:22
-
-
Save zloadmin/8dc1dba93348771680ace8c6d5f49885 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
private function getArrayRequest(string $token, array $data, bool $ios = false): array | |
{ | |
if ($ios) $this->getIosArrayRequest($token, $data); | |
return $this->getAndroidArrayRequest($token, $data); | |
} | |
private function getIosArrayRequest(string $token, array $data) | |
{ | |
return [ | |
'notification' => [ | |
'title' => 'title', | |
'sound' => 'default', | |
'body' => 'body', | |
], | |
'mutable_content' => true, | |
'to' => $token, | |
'data' => $data, | |
]; | |
} | |
private function getAndroidArrayRequest(string $token, array $data) | |
{ | |
return [ | |
'to' => $token, | |
'data' => $data, | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment