Skip to content

Commit

Permalink
Merge pull request #20 from YieldStudio/18-command-check-expo-tickets…
Browse files Browse the repository at this point in the history
…-error-json_decode-argument-1-$json-must-be-of-type-string-array-given

Prevent json_decode on responseItem details which is array
  • Loading branch information
dtangdev authored Nov 14, 2023
2 parents 407391d + 0d5fc1d commit 9102290
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Dto/ExpoMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @author David Tang<david@yieldstudio.fr>
* @author James Hemery<james@yieldstudio.fr>
*/
final class ExpoMessage implements Jsonable, Arrayable
final class ExpoMessage implements Arrayable, Jsonable
{
public array $to;

Expand Down
2 changes: 1 addition & 1 deletion src/ExpoNotificationsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function receipts(Collection|array $tokenIds): Collection
if ($responseItem['status'] === ExpoResponseStatus::ERROR->value) {
$data
->message($responseItem['message'])
->details(json_decode($responseItem['details'], true));
->details($responseItem['details']);
}

return $data;
Expand Down
2 changes: 1 addition & 1 deletion src/Jobs/CheckTickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
class CheckTickets
{
use Dispatchable;
use SerializesModels;
use Queueable;
use SerializesModels;

public function handle(
ExpoNotificationsService $expoNotificationsService,
Expand Down
2 changes: 1 addition & 1 deletion src/Jobs/SendPendingNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
class SendPendingNotifications
{
use Dispatchable;
use SerializesModels;
use Queueable;
use SerializesModels;

public function handle(
ExpoNotificationsService $expoNotificationsService,
Expand Down

0 comments on commit 9102290

Please sign in to comment.