✅ [Android] Receive notifications while app in foreground or background
✅ [Web] Receive notifications while app in foreground or background
❌ [IOS] Receive notifications while app in foreground or background
✅ [Android] Send notifications
✅ [Web] Send notifications
❌ [IOS] Send notifications
✅ [Android] Save all notifications in a firebase database
✅ [Web] Save all notifications in a firebase database before sending then
❌ [IOS] Save all notifications in a firebase database
About • How to run it • Technologies • Author • License
This project was created so that I would learn how to receive and send notifications via firebase's cloud messaging service, while also saving it in firebase's database for notification management.
Before beginning, you'll need to have installed the following tools in your machine: Git, Chrome, Flutter, FlutterFire CLI, an editor like VSCode.
You'll also need to have an account on Google's Firebase and a project created to configure the app.
Before starting, you'll need copy whats inside the file /lib/firebase_options.dart
to another file, it'll be substitute after you run the following commands.
To configure the application, you'll need to run the following commands:
# Clone the repository
$ git clone git@github.com:gabitchian/flutter-fcm.git
# Access the repositories's folder
$ cd flutter-fcm
# Configure project for firebase
$ flutterfire configure
When running futterfire configure, you'll be prompted with a few questions:
-
The project that will be connected to your App: you can create one while configuring or select one that was already created.
-
What plataforms you want to configure support: you should select android, IOS and Web for this example
-
It'll probably ask if you want to substitute your current configuration, mark yes
After configuring it, you'll need to get the current values on the
/lib/firebase_options.dart
file to their respective variable in the.env-example
and theweb/firebase-messaging-sw-example.js
. Then you can rename.env-example
to.env
andweb/firebase-messaging-sw-example.js
toweb/firebase-messaging-sw.js
and also so paste back to/lib/firebase_options.dart
what you saved in another temporary file.
# Clone the repository
$ git clone git@github.com:gabitchian/flutter-fcm.git
# Access the repositories's folder
$ cd flutter-fcm
# Run on the opened emulator, such as Android or IOS device
$ flutter run
# Or
$ flutter run -d chrome
# Run on the browser, your app will open in a new tab automatically
The following tools were use on this project:
App (Flutter + FlutterFire CLI)
- Editor: Visual Studio Code
- README: BrunoSaibert's Template
- Google Chrome: Chrome
Gabriela Tchian
Made by Gabriela Tchian
👋 Contact me at:
This project is under the MIT license.