Skip to content

Commit

Permalink
do not always set content-available and mutable-content
Browse files Browse the repository at this point in the history
  • Loading branch information
koenhoeijmakers committed Nov 24, 2020
1 parent b2b4972 commit 853cfd1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/ApnAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ public function adapt(ApnMessage $message, string $token)
}

$payload = Payload::create()
->setAlert($alert)
->setContentAvailability((bool) $message->contentAvailable)
->setMutableContent((bool) $message->mutableContent);
->setAlert($alert);

if ($contentAvailable = $message->contentAvailable) {
$payload->setContentAvailability((bool) $message->contentAvailable);
}

if ($mutableContent = $message->mutableContent) {
$payload->setMutableContent((bool) $message->mutableContent);
}

if (is_int($badge = $message->badge)) {
$payload->setBadge($badge);
Expand Down

0 comments on commit 853cfd1

Please sign in to comment.