Closed vahidzoli closed 3 years ago
i wrote a test,but every time execute it,i got same error,here is my code,
$users = []; $beamsClient = new PushNotifications(array( "instanceId" => config('services.pusher.beams_instance_id'), "secretKey" => config('services.pusher.beams_secret_key'), )); $tmp = User::where('role', 'client')->pluck('id')->toArray(); foreach ($tmp as $t){ $users[] = (string)$t; } $publishResponse = $beamsClient->publishToUsers( $users, array( "fcm" => array( "notification" => array( "title" => "Test", "body" => "This is a test" ), "data" => array( "key" => "This is a test" ) ), "apns" => array("aps" => array( "alert" => array( "title" => "Test", "body" => "This is a test" ) )) )); return ok($publishResponse,200);
$users = []; $beamsClient = new PushNotifications(array( "instanceId" => config('services.pusher.beams_instance_id'), "secretKey" => config('services.pusher.beams_secret_key'), )); $tmp = User::where('role', 'client')->pluck('id')->toArray(); foreach ($tmp as $t){ $users[] = (string)$t; } $publishResponse = $beamsClient->publishToUsers( $users, array( "fcm" => array( "notification" => array( "title" => "Test", "body" => "This is a test" ), "data" => array( "key" => "This is a test" ) ), "apns" => array("aps" => array( "alert" => array( "title" => "Test", "body" => "This is a test" ) )) ));
return ok($publishResponse,200);
how to solve it?
Closing due to inactivity
i wrote a test,but every time execute it,i got same error,here is my code,
how to solve it?