useApplicationDefaultCredentials(); $client->addScope('https://www.googleapis.com/auth/firebase.messaging'); $httpClient = $client->authorize(); $token = "f2lMMUNKR9SOQcVZFm7VUJ:APA91bHnfv3D2yxAPX9lXT81ovuH6gDgga6ZrNXRwAZZE5xa7AcjWzeKAON-7s1oAVM4AwTSgjb-IkmT5NvujjqSib9wFCcwaPX205dh8rSGAj6ltTp670dTkdbVIykefURMoG8EhFQd"; // Your Firebase project ID $project = "narkampen"; // Creates a notification for subscribers to the debug topic $message = [ "message" => [ "token" => $token, "notification" => [ "body" => "This is an FCM notification message!", "title" => "FCM Message", ] ] ]; // Send the Push Notification - use $response to inspect success or errors $response = $httpClient->post("https://fcm.googleapis.com/v1/projects/{$project}/messages:send", ['json' => $message]); var_dump($response);