This Flutter project allows you to send push notifications to your users through Firebase Cloud Messaging. It guides you through the process of configuring and using Firebase to send notifications to your Flutter application.
Follow the steps below to set up Firebase and run the project.
- Visit the Firebase website: https://console.firebase.google.com/.
- Click "Add project" to create a new Firebase project.
- Follow the instructions to set up your Firebase project.
- Ensure you have Node.js installed on your system. If not, you can download it from the official website: https://nodejs.org/.
- Install the Firebase CLI using the following command:
npm install -g firebase-tools
- Run the following command to log in to Firebase:
firebase login
- Follow the prompts to log in with your Google account.
- Install the FlutterFire CLI using the following command:
dart pub global activate flutterfire_cli
- Run the following command to configure FlutterFire with Firebase:
flutterfire configure
- Follow the steps to link your Flutter project to Firebase.
- To run the Flutter project, use the following command in the project directory:
flutter run
- The Flutter application will be deployed to your device or emulator.
- Retrieve the FCM token that it displays on your terminal.
- Access your Firebase project's console: https://console.firebase.google.com/.
- Select your project.
- In the "Engage" or "Notifications" tab, choose "Messaging" to configure and send push messages to your application.
- After configuring your message, it will ask you to enter the FCM token that you copied from your terminal to be able to send the notification.
- Don't forget to allow notifications on the app settings, otherwise you may not receive notifications.
Now that your Flutter project is set up for Firebase Cloud Messaging, you can start sending notifications to your users. Refer to the Firebase Cloud Messaging documentation for more information on creating and sending push messages: https://firebase.google.com/docs/cloud-messaging.