Firebase Cloud Messaging (FCM) Flutter package

  chat, Plugin, plugin, SMS

Firebase Messaging Plugin for Flutter

A Flutter plugin to use the Firebase Cloud Messaging API.

To learn more about Firebase Cloud Messaging, please visit the Firebase website

Getting Started

To get started with Firebase Cloud Messaging for Flutter, please see the documentation.

Why flutter_fcm?

  • rocket Easy to use
  • zap Supports local notification

Usage

The easiest way to use this library is via the top-level functions.

import 'package:flutter_fcm/flutter_fcm.dart';

class Messaging {
  static String token;
  static initFCM()async{
    try{
      await FCM.initializeFCM(
          onNotificationPressed: (Map<String, dynamic> data) {

          },
          onTokenChanged: (String token) {
            Messaging.token = token;
            print(token);
          },
          icon: 'icon'
      );
    }catch(e){}
  }
}

Download Firebase Messaging Plugin source code on GitHub

https://github.com/wh120/flutter_fcm