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

setNotificationOnAppKillContent not work correctly in iOS 15.5 #183

Closed hiepjozu closed 7 months ago

hiepjozu commented 7 months ago

Alarm plugin version: 3.0.14

Describe the bug: I set multi alarm on project with this setting. final alarmSettings = AlarmSettings( id: id, dateTime: time, assetAudioPath: AlarmServiceConst.ringtons, notificationTitle: Platform.isAndroid ? ValidateUtils.l10n.appName : '', notificationBody: Platform.isAndroid ? ValidateUtils.l10n.notificationImportantContent : '', androidFullScreenIntent: false, ); and I config await Alarm.setNotificationOnAppKillContent(title, content) but it show one time on iOS 15.5

Device info Iphone 7 iOS 15.5

gdelataillade commented 7 months ago

Hi @hiepjozu

Could you be more specific please ? I'm not sure to understand your issue.

Make sure to:

hiepjozu commented 7 months ago

Thanks @gdelataillade . Must I call Alarm.setNotificationOnAppKillContent every Alarm.set or one time when init alarm?

gdelataillade commented 7 months ago

Thanks @gdelataillade . Must I call Alarm.setNotificationOnAppKillContent every Alarm.set or one time when init alarm?

Just one time after running await Alarm.init.

hiepjozu commented 7 months ago

Thanks @gdelataillade . Must I call Alarm.setNotificationOnAppKillContent every Alarm.set or one time when init alarm?

Just one time after running await Alarm.init.

So if I set multiple alarm. Is it NotificationOnAppKill will await when set alarm completed and NotificationOnAppKill will work right? And it show one time or every time when user kill app?

gdelataillade commented 7 months ago

Yes. I recommend to call Alarm.setNotificationOnAppKillContent once, in the main function, just after the await Alarm.init. It will work every time user kill the app.

Let me know if you have any other question and if we can close the issue.

younesouhbi commented 7 months ago

@gdelataillade How would you recommend handling a situation where the user can switch the locale of the app mid-session? The OnKillNotification will fire with the startup locale instead of the current. Is there a way to reset it later?

gdelataillade commented 7 months ago

@younesouhbi

The on-kill-notification is shown at the moment the app gets terminated, it is not scheduled. About the time zone change, I'm currently working on it here #165. It might take a while though.

gdelataillade commented 7 months ago

I'm closing this issue because the OnKillNotification issue is resolved. Please refer to #164 issue and #165 PR for the time zone change management.