Skip to content

Commit

Permalink
Try @edamov's suggestion on edamov#78
Browse files Browse the repository at this point in the history
  • Loading branch information
angvp-sng committed Nov 17, 2019
1 parent aab34b3 commit f735956
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,9 @@ private function prepareApnsHeaders(Notification $notification)
}
// new header required to support iOS 13
$this->headers[self::HEADER_APNS_PUSH_TYPE] = 'alert';
$payload = $notification->getPayload();
try {
$apnsTopic = $payload->getCustomValue(self::HEADER_APNS_TOPIC);
} catch (InvalidPayloadException $e) {
}
if ($notification->getPayload()->isContentAvailable()) {
$this->headers[self::HEADER_APNS_PUSH_TYPE] = 'background';
}
if (isset($apnsTopic) && !empty($apnsTopic)) {
$this->headers[self::HEADER_APNS_TOPIC] = $apnsTopic;
} elseif (isset($this->headers[self::HEADER_APNS_TOPIC])) {
$this->headers[self::HEADER_APNS_PUSH_TYPE] = 'voip';
}
}
Expand Down

0 comments on commit f735956

Please sign in to comment.