Skip to content

Commit

Permalink
Fix warning when gcm notification fails and no message-id is present
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian committed Jun 14, 2016
1 parent fbe3d79 commit 83f1a6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Khrizt/PushNotiphications/Model/Gcm/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ class Response implements ResponseInterface
public static function parse(string $token, array $body) : Response
{
$response = new self();
$response->notificationId = $body['message_id'];
$response->token = $token;
if (array_key_exists('message_id', $body)) {
$response->notificationId = $body['message_id'];
}
if (array_key_exists('registration_id', $body)) {
$response->canonicalId = $body['registration_id'];
}
Expand Down

0 comments on commit 83f1a6a

Please sign in to comment.