Skip to content

Commit 48361ca

Browse files
GroupTopic
1 parent 96e2361 commit 48361ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Message.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Message implements \JsonSerializable
4949
*/
5050
public function addRecipient(Recipient $recipient)
5151
{
52-
if (!$recipient instanceof Device && !$recipient instanceof Topic) {
52+
if (!$recipient instanceof Device && !$recipient instanceof Topic && !$recipient instanceof GroupTopic) {
5353
throw new \UnexpectedValueException('currently phpFCM only supports topic and single device messages');
5454
}
5555

@@ -202,7 +202,7 @@ function (Topic $topic) { return sprintf("'%s' in topics", $topic->getIdentifier
202202
case GroupTopic::class:
203203
if (count($this->recipients) > 1) {
204204
$topics = array_map(
205-
function (Topic $topic) { return sprintf("'%s' in topics", $topic->getIdentifier()); },
205+
function (GroupTopic $topic) { return sprintf("'%s' in topics", $topic->getIdentifier()); },
206206
$this->recipients
207207
);
208208
$jsonData['condition'] = implode(' && ', $topics);

0 commit comments

Comments
 (0)