gdelataillade / alarm

A Flutter plugin to easily manage alarms on iOS and Android
https://pub.dev/packages/alarm
MIT License
132 stars 86 forks source link

full screen intent problem #245

Closed jys324 closed 1 month ago

jys324 commented 1 month ago

my version: 3.1.4

Even if full screen intent is set to true, the screen does not appear when moving to the background after setting the alarm. I've already used auto_start_flutter package and got isAutoStartAvailable message but the alarm screen was not appeared. The music is played and only a small notification appears above.

code:
var alarmSettings = AlarmSettings( id: id dateTime: dateTime, loopAudio: true, vibrate: true, volume: widget.volume, fadeDuration: 3.0, assetAudioPath: Music, notificationTitle: 'Alarm ringing !', notificationBody: 'Periodic alarm ringing, day ${dateTime.day}.', enableNotificationOnKill: true, androidFullScreenIntent: true ); await Alarm.set( alarmSettings: alarmSettings, );

my devices: samsung galaxy note 10, samsung s22.

If this is my only problem, I would appreciate it if you could tell me a solution

BrainNim commented 1 month ago

Hello! Could you please let me know how you solved this issue?

jys324 commented 1 month ago

I had mistaken androidFullScreenIntent: as a setting to automatically open the app. If this is what you are looking for, you can run this function in Kotlin:

private fun bringAppToForeground() { val intent = Intent(this, MainActivity::class.java) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_REORDER_TO_FRONT) startActivity(intent) }

Because I can't run the app when it dies, I hope to add this to the package itself..!