Step-by-step instructions to correctly use device registration token, project ID, and service account JSON for FCM HTTP v1 API in PHP: 1. Obtain Device Registration Token from Client App: - Android: Use FirebaseMessaging.getInstance().getToken() in your Android app code. Example: FirebaseMessaging.getInstance().getToken() .addOnCompleteListener(task -> { if (!task.isSuccessful()) { Log.w(TAG, "Fetching FCM registration token failed", task.getException()); return; } String token = task.getResult(); Log.d(TAG, "FCM Token: " + token); }); - iOS: Implement messaging:didReceiveRegistrationToken: delegate method in your AppDelegate. Example: func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) { print("FCM token: \(fcmToken ?? "")") } - Web: Use getToken() from Firebase messaging SDK. Example: messaging.getToken({ vapidKey: 'YOUR_PUBLIC_VAPID_KEY' }).then((currentToken) => { if (currentToken) { console.log('FCM Token:', currentToken); } else { console.log('No registration token available.'); } }); 2. Ensure Service Account JSON: - Download the service account JSON file from Firebase Console for the same project as your client app. - Go to Firebase Console > Project Settings > Service Accounts > Generate new private key. 3. Set Project ID in PHP Script: - Open your PHP script (e.g., fcm_http_v1.php). - Set the $projectId variable to the "project_id" value from your service account JSON file. 4. Replace Device Token in PHP Script: - Replace 'YOUR_DEVICE_REGISTRATION_TOKEN' in the $message array with the actual token obtained from your client app. 5. Run the PHP Script: - Ensure you have installed google/apiclient via composer. - Run the script from the command line: php fcm_http_v1.php - Check the output for success or error messages. Following these steps will ensure your PHP script sends FCM messages correctly using the HTTP v1 API. If you need help with any specific step, please let me know.