Skip to content

Commit 126e319

Browse files
committed
Set recipient and refactoring
1 parent af98e9a commit 126e319

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@
1919
"psr-4": {
2020
"RedjanYm\\FCM\\": "src/"
2121
}
22+
},
23+
"require-dev": {
24+
"symfony/var-dumper": "^7.2"
2225
}
2326
}

examples/messaging.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@
1717
$notification = new Notification($recipient, 'Title', 'Body', ['key' => 'value']);
1818

1919
$response = $client->send($notification);
20-
21-
var_dump($response->getBody()->getContents());
20+
dump($response->getBody()->getContents());

src/Notification.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public function jsonSerialize()
4141
return [
4242
$this->recipient->getType() => $this->recipient->getTarget(),
4343
'notification' => [
44-
// https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification
4544
'title' => $this->title,
4645
'body' => $this->body,
4746
'image' => $this->image,

src/Recipient/Device.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ public function getTarget(): string
1818

1919
public function getType(): string
2020
{
21-
return 'topic';
21+
return 'token';
2222
}
2323
}

0 commit comments

Comments
 (0)