Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a test device to Firebase Cloud Messaging (FCM) in flutter

I have a flutter application with Firebase Cloud Messaging (FCM) integration but I want to add my physical device or emulator as a test device to test the notifications on this device only without releasing to all production devices .. how can I achieve that ?

like image 311
Ahmed Osama Avatar asked Oct 11 '25 20:10

Ahmed Osama


1 Answers

follow this steps :

1- add a debug print of the FCM token to your apps start by adding this line :

FirebaseMessaging.instance.getToken().then((value) => print(value));

2- run your app in debug mode and copy the token , it will look like this :

I/flutter ( 6513): Really_lage_token

3- login to your Firebase console and add a new notification :

enter image description here

4- click on send test message and add your token from step 2

enter image description here

5- click test and repeat for each test notification .

like image 69
Ahmed Osama Avatar answered Oct 14 '25 14:10

Ahmed Osama