From ff2d42e588fd8619b7acb92ef17ede957e648e59 Mon Sep 17 00:00:00 2001 From: mohsen shamohammadi Date: Sun, 24 Dec 2017 12:13:43 +0330 Subject: [PATCH 1/3] batch send failure #31 create a nwe connection if sending a message failed because apple ignores rest of tokens on that connection --- src/ApnChannel.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ApnChannel.php b/src/ApnChannel.php index 45c0789..b779e23 100644 --- a/src/ApnChannel.php +++ b/src/ApnChannel.php @@ -107,6 +107,10 @@ public function send($notifiable, Notification $notification) 'error' => $response->getCode(), ]) ); + + //connection is useless so create a new connection + $this->closeConnection(); + $this->openConnection(); } } catch (Exception $e) { throw SendingFailed::create($e); From 7e47486bba22516c855bb37ed5f71f71d157e537 Mon Sep 17 00:00:00 2001 From: mohsen shamohammadi Date: Sun, 24 Dec 2017 12:24:27 +0330 Subject: [PATCH 2/3] fix coding style --- src/ApnChannel.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ApnChannel.php b/src/ApnChannel.php index b779e23..f18e6fb 100644 --- a/src/ApnChannel.php +++ b/src/ApnChannel.php @@ -107,7 +107,6 @@ public function send($notifiable, Notification $notification) 'error' => $response->getCode(), ]) ); - //connection is useless so create a new connection $this->closeConnection(); $this->openConnection(); From 4a65cadd909cab4d64979d6d875387b75e26ff8b Mon Sep 17 00:00:00 2001 From: mohsen shamohammadi Date: Sun, 24 Dec 2017 12:27:46 +0330 Subject: [PATCH 3/3] fix coding style --- tests/ApnChannelTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ApnChannelTest.php b/tests/ApnChannelTest.php index 4ac3480..a35862f 100644 --- a/tests/ApnChannelTest.php +++ b/tests/ApnChannelTest.php @@ -2,14 +2,14 @@ namespace NotificationChannels\Gcm\Test; +use Mockery; +use PHPUnit_Framework_TestCase; use Illuminate\Events\Dispatcher; use Illuminate\Notifications\Notifiable; use NotificationChannels\Apn\ApnChannel; -use Illuminate\Notifications\Notification; -use NotificationChannels\Apn\ApnFeedback; use NotificationChannels\Apn\ApnMessage; -use PHPUnit_Framework_TestCase; -use Mockery; +use NotificationChannels\Apn\ApnFeedback; +use Illuminate\Notifications\Notification; use ZendService\Apple\Apns\Client\Message as Client; use ZendService\Apple\Apns\Client\Feedback as FeedbackClient; use ZendService\Apple\Apns\Response\Message as MessageResponse;