From 5de127366f2b0f1e4368d600c52ab40f08d1059e Mon Sep 17 00:00:00 2001 From: David TANG Date: Wed, 15 Nov 2023 15:15:11 +0100 Subject: [PATCH] feat: manage instable responseItem details format from API --- src/ExpoNotificationsService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ExpoNotificationsService.php b/src/ExpoNotificationsService.php index 43e72b3..754eede 100644 --- a/src/ExpoNotificationsService.php +++ b/src/ExpoNotificationsService.php @@ -119,9 +119,11 @@ public function receipts(Collection|array $tokenIds): Collection ->status($responseItem['status']); if ($responseItem['status'] === ExpoResponseStatus::ERROR->value) { + $responseItemDetails = is_string($responseItem['details']) ? json_decode($responseItem['details']) : $responseItem['details']; + $data ->message($responseItem['message']) - ->details($responseItem['details']); + ->details($responseItemDetails); } return $data;