Fcm Token Manager

style: very good analysis Powered by Mason License: MIT

A Very Good Project created by Very Good CLI.


Interface between Firebase Core and Firebase Messaging which helps in managing FCM tokens and notifications permissions.

It makes the following assumptions:

  1. Your app has a backend
  2. Your backend allows for updating user token and deleting of a user token
  3. Your backend stores FCM tokens associated with string-based user ID


  1. onLogin: It will check when was the last time your backend was updated with an FCM token and update it if it was longer than configured token ttl
  2. onLogout: It will remove token from backend on logout

Storing user preference re: notifications and asking for permission

  1. Calling getAppNotificationPreference:
  • will return current permission status, unless no permission is set in which case it will
  • ask user for permission (using native iOS/Android process)
  1. Using setAppNotificationPreference enables user to switch off notifications without using the device native preferences
  • this simply calls your backend to delete the FCM token

Installation 💻

❗ In order to start using Fcm Token Manager you must have the Flutter SDK installed on your machine.

Install via flutter pub add:

dart pub add fcm_token_manager

Continuous Integration 🤖

Fcm Token Manager comes with a built-in GitHub Actions workflow powered by Very Good Workflows but you can also add your preferred CI/CD solution.

Out of the box, on each pull request and push, the CI formats, lints, and tests the code. This ensures the code remains consistent and behaves correctly as you add functionality or make changes. The project uses Very Good Analysis for a strict set of analysis options used by our team. Code coverage is enforced using the Very Good Workflows.