Ahmed Osama
Ahmed Osama

Reputation: 812

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 ?

Upvotes: 4

Views: 2975

Answers (1)

Ahmed Osama
Ahmed Osama

Reputation: 812

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 .

Upvotes: 2

Related Questions