Skip to content

Commit

Permalink
Partially Revert #64 to fix #69 (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurk91 authored Nov 26, 2020
1 parent c2f085d commit b45ae94
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/FcmChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@
use Kreait\Firebase\Messaging as MessagingClient;
use Kreait\Firebase\Messaging\CloudMessage;
use Kreait\Firebase\Messaging\Message;
use Kreait\Laravel\Firebase\Facades\FirebaseMessaging;
use NotificationChannels\Fcm\Exceptions\CouldNotSendNotification;
use Throwable;

class FcmChannel
{
const MAX_TOKEN_PER_REQUEST = 500;

/**
* @var MessagingClient
*/
protected $client;

/***
* @var Dispatcher
*/
Expand All @@ -29,12 +25,10 @@ class FcmChannel
/**
* FcmChannel constructor.
*
* @param MessagingClient $client
* @param Dispatcher $dispatcher
*/
public function __construct(MessagingClient $client, Dispatcher $dispatcher)
public function __construct(Dispatcher $dispatcher)
{
$this->client = $client;
$this->events = $dispatcher;
}

Expand Down Expand Up @@ -99,7 +93,7 @@ protected function sendToFcm(Message $fcmMessage, $token)
$fcmMessage->setToken($token);
}

return $this->client->send($fcmMessage);
return FirebaseMessaging::send($fcmMessage);
}

/**
Expand All @@ -111,7 +105,7 @@ protected function sendToFcm(Message $fcmMessage, $token)
*/
protected function sendToFcmMulticast($fcmMessage, array $tokens)
{
return $this->client->sendMulticast($fcmMessage, $tokens);
return FirebaseMessaging::sendMulticast($fcmMessage, $tokens);
}

/**
Expand Down

0 comments on commit b45ae94

Please sign in to comment.