Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Owner and Founder. Opencart
Top Partners
Flutter is on pace in gathering more and more userbase every day. With its increasing popularity, push notification is a feature that is a must-have so that the app can be made more interactive.
To add a push notification feature to the flutter app, Google has provided a powerful platform that is Firebase. With Firebase Cloud Messaging we can enable push notification feature for iOS and Android app at the same time.
Let’s start with the code-based implementation.
At first, we will need to add firebase_messaging package to our pubspec.yaml file.
Now we will need to add some boilerplate code to enable push notification in the Android app.
Add the google-services.json file downloaded from the firebase project and place it inside android/app. Assuming you are familiar with thegoogle-services.json.
google-services.json
android/app
Then, make sure to add to your root-level build.gradle file:
Then, in your module-level Gradle file (usually the app/build.gradle), add the ‘apply plugin’ line at the bottom of the file to enable the Gradle plugin:
If want to be notified in your app (via onResume and onLaunch, see below) when the user clicks on a notification in the system tray include the following intent-filter within the <activity> tag of your android/app/src/main/AndroidManifest.xml:
onResume
onLaunch
intent-filter
<activity>
android/app/src/main/AndroidManifest.xml
In this way, we can start receiving notifications in our Flutter app. In the upcoming blog, we will see how to handle background notifications.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
All communication is done through a ticket system. I appreciate the regular almost daily updates of what is being worked on, and communicating changes or updates is easy through this system. Mobikul's response timeframe is quick.
Josh Arnold
Owner, Shop ATV Escape
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.