Skip to content

Commit

Permalink
Update AppleNotification.php
Browse files Browse the repository at this point in the history
  • Loading branch information
TCB13 authored Feb 19, 2019
1 parent aab5b4e commit f51f7d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/NotificationHubsRest/Notification/AppleNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ public function getPayload()
}

if (is_array($this->alert)) {
$alert = array_intersect_key($this->alert, array_fill_keys($this->supportedAlertProperties, 0));
$payload += ['alert' => $alert];
if (!empty($alert)) {
$alert = array_intersect_key($this->alert, array_fill_keys($this->supportedAlertProperties, 0));
$payload += ['alert' => $alert];
}
} elseif (is_scalar($this->alert)) {
$payload += ['alert' => $this->alert];
} else {
Expand Down

0 comments on commit f51f7d4

Please sign in to comment.