diff --git a/src/NotificationHubsRest/Notification/AppleNotification.php b/src/NotificationHubsRest/Notification/AppleNotification.php index 956b8db..b6c5e12 100644 --- a/src/NotificationHubsRest/Notification/AppleNotification.php +++ b/src/NotificationHubsRest/Notification/AppleNotification.php @@ -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($this->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 {