Firebase (FCM) registration token in Flutter

前端 未结 4 1438
暗喜
暗喜 2021-02-12 14:26

I am trying to send notification from Java Rest Api (using Firebase Admin sdk) to my Flutter application and it seems it requ

4条回答
  •  孤独总比滥情好
    2021-02-12 15:10

    We need to add this package in pubspec.yaml file

    firebase_messaging: ^4.0.0+1
    

    Perform packages get

    Now import this in your code

    import 'package:firebase_messaging/firebase_messaging.dart';
    

    Create instance of FirebaseMessaging

      FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
    

    Now we just to add the function which I have created in the answer in the link below

    https://stackoverflow.com/a/60523014/11887774

提交回复
热议问题