0

I want to launch/execute app from certain background events even when app is killed/terminated in flutter.

For an example in alarm app when alarm is triggered we launch app or show alarm screen. in my case i want to launch app(also play audio) when FirebaseMessaging.onBackgroundMessaging is called without any user actions.

examples will be really helpful. Thanks

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

1 Answers1

0

In Android, you can launch your app when the alarm is fired. Use the android_alarm_manager_plus plugin with this hack.

The AlarmBroadcastReceiver.onRecieve() function will be run when the alarm is fired, and then your app will be launched.

And launching the app in the background is needed permissions so reference this answer.

MaNDOOoo
  • 1,347
  • 1
  • 5
  • 19