fcm_config 2.0.0-dev.3 copy "fcm_config: ^2.0.0-dev.3" to clipboard
fcm_config: ^2.0.0-dev.3 copied to clipboard

outdated

This flutter package is made to merge between firebase_messaging package and flutter_local_notifications

fcm_config #

What can this packge do #

  • Show fcm notification while app is in forground
  • Easly recieve incoming notification where you are
  • Easly recieve clicked where you are
  • Notification is an object

Setup #

Android #

Go here https://firebase.flutter.dev/docs/installation/android

Ios #

Go here https://firebase.flutter.dev/docs/installation/ios

Android #

Go here https://firebase.flutter.dev/docs/installation/macos

Dart/Flutter #

Initialize

 await FCMConfig.init(appAndroidIcon: 'ic_launcher');
FCMConfig.getToken().then((token) {
      print(token);
 });

To get notification that launched the application

 await FCMConfig.getInitialMessage();
 

Now if you need to get the incomming notification :

First option #

class MyScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return FCMNotificationListener(
      onNotification:
          (FCMNotification notification, void Function() setState) {},
      child: SizedBox(),
    );
  }
}

Second option #

class MyScreen extends StatefulWidget {
  @override
  _MyScreenState createState() => _MyScreenState();
}

class _MyScreenState extends State<MyScreen>
    with FCMNotificationMixin {
  @override
  Widget build(BuildContext context) {
    return SizedBox();
  }

  @override
  void onNotify(FCMNotification notification) {
    // do some thing
  }
}

additional property translateMessage that can be passed in intialize to translate body_loc_key,title_loc_key it currently support only forground notification #

135
likes
0
points
1.25k
downloads

Publisher

verified publishernew-step-apps.com

Weekly Downloads

This flutter package is made to merge between firebase_messaging package and flutter_local_notifications

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

firebase_core, firebase_messaging, flutter, flutter_local_notifications

More

Packages that depend on fcm_config