How to get an FCM device token for notification testing

An FCM registration token identifies an app registration that Firebase Cloud Messaging can target for a single-device push notification test.

What is an FCM registration token?

The Firebase Messaging client SDK creates a registration for the app installation and exposes a token that your server can use as a message target. Tokens can change, so use a current value from the device you are testing.

Flutter example

final messaging = FirebaseMessaging.instance;
await messaging.requestPermission();
final token = await messaging.getToken();
print(token);

Android and iOS considerations

Your app must be correctly configured for Firebase Messaging. On newer Android and Apple platforms, notification permission can also affect whether a delivered notification is displayed. Apple platforms additionally require valid APNs configuration in Firebase.

Use the token in the tester

Copy the token from your app and paste it into the Firebase notification tester. Use the service account JSON from the same Firebase project as the target registration.

See Firebase's FCM setup guides for platform-specific client configuration.