Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter schedule local notification by workManager

Is it possible to schedule notification from background dart code?

For example, like using work_manager plugin from executeTask method as if I register service that runs every hour and schedule today notification base on current location.

I tried out but no luck.

Can anyone help me with that?

like image 266
Ethan Hunt Avatar asked Sep 11 '26 15:09

Ethan Hunt


1 Answers

In order schedule notifications work you should add lines below. Solution is this: add these lines after </activity> in AndroidManifest.xml:

<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED"></action>
    </intent-filter>
    </receiver>
    <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
like image 51
ruslanhasanoff Avatar answered Sep 13 '26 10:09

ruslanhasanoff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!