diff --git a/src/Message.php b/src/Message.php index acf3570..bbe2061 100644 --- a/src/Message.php +++ b/src/Message.php @@ -28,6 +28,7 @@ class Message implements \JsonSerializable private $recipientType; private $timeToLive; private $delayWhileIdle; + private $dryRun; /** * Represents the app's "Send-to-Sync" message. @@ -123,6 +124,19 @@ public function setDelayWhileIdle($delayWhileIdle) return $this; } + /** + * @see https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream-http-messages-json + * + * @param bool $dryRun + * + * @return \paragraph1\phpFCM\Message + */ + public function setDryRun($dryRun) + { + $this->dryRun = $dryRun; + return $this; + } + /** * @see https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages * @@ -169,6 +183,9 @@ public function jsonSerialize() if ($this->contentAvailableFlag === TRUE) { $jsonData['content_available'] = TRUE; } + if ($this->dryRun === TRUE) { + $jsonData['dry_run'] = TRUE; + } return $jsonData; }