US Office

1176 Shadeville Rd, Crawfordville Florida 32327, USA

 +1 (850) 780-1313

India Office

Office No 405, Kabir Shilp, Opp. Kansar Hotel, Opp. Landmark, Kudasan, Gandhinagar, Gujarat 382421

[email protected]

How to Get Firebase Token In Flutter??

How to Get Firebase Token In Flutter

How to Get Firebase Token In Flutter??

When users trying to send a notification from Rest Api using Firebase Admin SDK to the Flutter Application and it seems it requires a device token to send a notification. So in this article, we will go through How to Get Firebase Token In Flutter.

Are you ready for the same?

Let’s Drive through the same.

How to Get Firebase Token In Flutter??

Add this to your package’s pubspec.yaml file as shown here:

  firebase_messaging: ^6.0.16

You can install packages from the command line:

with Flutter like the below:

flutter pub get

Now in your file import package like the below:

import 'package:firebase_messaging/firebase_messaging.dart';

Implementation would be as the below snippet:

final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
    onLaunch: (Map<String, dynamic> message) {
      print('onLaunch called');
    onResume: (Map<String, dynamic> message) {
      print('onResume called');
    onMessage: (Map<String, dynamic> message) {
      print('onMessage called');
    sound: true,
    badge: true,
    alert: true,
      .listen((IosNotificationSettings settings) {
  _firebaseMessaging.getToken().then((token) {
    print(token); // Print the Token in Console

you can refer here, to know more about how to Integrate Push Notification For iOS In Flutter.


So in this article, we have been through How to Get Firebase Token In Flutter.

Thanks for Reading !!! we hope you have learned well ūüôā

Keep Learning !!! Keep Fluttering !!!

Do let us know if you need any assistance with Flutter Development. Don’t forget to drop your valuable feedback in the comments, It keeps us moving! is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget Guide, Flutter Projects, Code libs and etc. is one of the most popular online portals dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge of Flutter.

Post a Comment