updated-packages
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace LaravelFCM;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use LaravelFCM\Sender\FCMGroup;
|
||||
use LaravelFCM\Sender\FCMSender;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
@@ -12,7 +13,7 @@ class FCMServiceProvider extends ServiceProvider
|
||||
|
||||
public function boot()
|
||||
{
|
||||
if (str_contains($this->app->version(), 'Lumen')) {
|
||||
if (Str::contains($this->app->version(), 'Lumen')) {
|
||||
$this->app->configure('fcm');
|
||||
} else {
|
||||
$this->publishes([
|
||||
@@ -23,7 +24,7 @@ class FCMServiceProvider extends ServiceProvider
|
||||
|
||||
public function register()
|
||||
{
|
||||
if (!str_contains($this->app->version(), 'Lumen')) {
|
||||
if (!Str::contains($this->app->version(), 'Lumen')) {
|
||||
$this->mergeConfigFrom(__DIR__.'/../config/fcm.php', 'fcm');
|
||||
}
|
||||
|
||||
|
@@ -93,6 +93,7 @@ class OptionsBuilder
|
||||
* @return \LaravelFCM\Message\OptionsBuilder
|
||||
*
|
||||
* @throws InvalidOptionsException
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public function setPriority($priority)
|
||||
{
|
||||
@@ -160,12 +161,12 @@ class OptionsBuilder
|
||||
*
|
||||
* @return \LaravelFCM\Message\OptionsBuilder
|
||||
*
|
||||
* @throws InvalidOptionException
|
||||
* @throws InvalidOptionsException
|
||||
*/
|
||||
public function setTimeToLive($timeToLive)
|
||||
{
|
||||
if ($timeToLive < 0 || $timeToLive > 2419200) {
|
||||
throw new InvalidOptionException("time to live must be between 0 and 2419200, current value is: {$timeToLive}");
|
||||
throw new InvalidOptionsException("time to live must be between 0 and 2419200, current value is: {$timeToLive}");
|
||||
}
|
||||
$this->timeToLive = $timeToLive;
|
||||
|
||||
@@ -309,6 +310,8 @@ final class OptionsPriorities
|
||||
|
||||
/**
|
||||
* @return array priorities available in fcm
|
||||
*
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public static function getPriorities()
|
||||
{
|
||||
@@ -323,6 +326,8 @@ final class OptionsPriorities
|
||||
* @param $priority
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public static function isValid($priority)
|
||||
{
|
||||
|
@@ -146,8 +146,10 @@ class PayloadNotification implements Arrayable
|
||||
];
|
||||
|
||||
// remove null values
|
||||
$notification = array_filter($notification);
|
||||
|
||||
$notification = array_filter($notification, function($value) {
|
||||
return $value !== null;
|
||||
});
|
||||
|
||||
return $notification;
|
||||
}
|
||||
}
|
||||
|
@@ -376,7 +376,7 @@ class DownstreamResponse extends BaseResponse implements DownstreamResponseContr
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tokens that you should resend using exponential backoof.
|
||||
* Get tokens that you should resend using exponential backoff.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@@ -105,7 +105,7 @@ class FCMSender extends HTTPSender
|
||||
*
|
||||
* @return null|\Psr\Http\Message\ResponseInterface
|
||||
*/
|
||||
private function post($request)
|
||||
protected function post($request)
|
||||
{
|
||||
try {
|
||||
$responseGuzzle = $this->client->request('post', $this->url, $request->build());
|
||||
|
Reference in New Issue
Block a user