laravel-notification-channels / pusher-push-notifications

Pusher Beams notifications channel for Laravel
http://laravel-notification-channels.com
MIT License
271 stars 67 forks source link

Unauthorized: Incorrect Secret Key #50

Closed vahidzoli closed 3 years ago

vahidzoli commented 4 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);

how to solve it?

atymic commented 3 years ago

Closing due to inactivity