Member-only story

Notification & Alarms in Flutter

Greg Perry
15 min readMar 17, 2020

Working with the Flutter Plugin, Android_Alarm_Manager.

Know this! This plugin only works for the Android platform! I personally don’t know of any iOS equivalent. Alternatively, a month after publishing this article, I came upon a plugin that provides notifications on both the Android and iOS platforms. I, of course, wrote an article and that as well. See below.

Notifications in Flutter

Know that if you want to use the plugin described here, you must follow its readme file explicitly to set things up correctly. You’re AndroidManfest.xml should at least look something like this below:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="NAME OF YOUR APPLICATION STARTING WITH COM.">
<!-- The INTERNET permission access.-->
<uses-permission android:name="android.permission.INTERNET"/>

<!-- android_alarm_manager -->
<!-- Start an Alarm When the Device Boots if past due -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- application needs to have the device stay on -->
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application
android:name="io.flutter.app.FlutterApplication"
android:label="code_samples"
android:icon="@mipmap/ic_launcher">
<activity…

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Greg Perry
Greg Perry

Responses (4)

Write a response

how to get this code

--

Thanks for the code and explanation.
I am new to flutter.I have executed your code in mobile.With this only flags are updated.I want alarm ringing on that time.Also I need to schedule alarm on a defined time.Can you suggest how I can accomplish that.

--

using your utility class doesn't call the callback ... instead a "{}" gets printed to the console at the time of call !
this is my callback
void printHello() {
print('*** Hello from alarm manager callback ***');
}
this it what gets printed after the time…

--