I need to implement a flutter alarm app that opens through the alarm manager. It seems that there is the way to do it using android_intent and android_alarm_manager_plus. I was looking for the right way to create such functionality, but this option does not work:
await AndroidAlarmManager.oneShot(
Duration(seconds: 2), 1, setAlarm);
void setAlarm()async{
AndroidIntent intent =
AndroidIntent(action: 'action_view', package: 'com.example.test_alarm');
await intent.launch().catchError((e) {
print(e.toString());
});
}
Debug console gives this:
I/IntentSender( 4886): Cannot resolve explicit intent - ignoring package
V/IntentSender( 4886): Sending intent Intent { act=android.intent.action.VIEW (has extras) }
try using https://pub.dev/packages/app_launcher
void setAlarm() async{
await AppLauncher.openApp(
androidApplicationId: "com.example.test_alarm",
);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With