diff --git a/src/JPush/core/PushPayload.php b/src/JPush/core/PushPayload.php index 06d8353..28dd8c2 100644 --- a/src/JPush/core/PushPayload.php +++ b/src/JPush/core/PushPayload.php @@ -515,8 +515,7 @@ public function build() { if (count($this->message) > 0) { $payload['message'] = $this->message; } - - if (is_null($payload['notification']) && is_null($payload['message'])) { + if (!array_key_exists('notification', $payload) && !array_key_exists('message', $payload)) { throw new InvalidArgumentException('notification and message can not all be null'); }