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

[iOS] How can I see if the onKillNotification works in Debug? #92

Closed dtkdt100 closed 1 year ago

dtkdt100 commented 1 year ago

Hello again! I am developing a package called: notification_when_app_is_killed, and I want to check fi the notification is working in ios.

I am working with your code (of course I will give you credit) and I will love your help.

Alarm plugin version latest Describe the bug In Debug, when the app is killed there is no onKill notification. Video: https://drive.google.com/file/d/1BoLUAz_IheNwl_nssPBDwVvkqARQAwP5/view?usp=sharing To Reproduce Steps to reproduce the behavior: Install the example and set alarm

Expected behavior Should send message

Screenshots If applicable, add screenshots to help explain your problem.

Device info iPhone 11, latest iOS

gdelataillade commented 1 year ago

Hi @dtkdt100,

That's awesome !

Check out the article I wrote about this, let me know if it helps ! https://medium.com/@gdelataillade/displaying-a-notification-when-your-flutter-app-is-killed-4ef25cc3f193

Here's the proof-of-concept I made too: https://github.com/gdelataillade/flutter_notif_on_kill_poc

Unfortunately, I couldn't find a way to show the notification when app is killed in debug mode. It only seem to work in release mode.

dtkdt100 commented 1 year ago

Hi, I read all of your articles already, awesome stuff!

I ran it also in release in Android studio and it also didn't work (the video is in release mode). Should it be on test flight? Because in iOS the release mode behaves as debug (you can't open the app without the cable)

gdelataillade commented 1 year ago

No, no need to make a TestFlight.

What I usually just do is to run flutter run --release in the terminal and once the build is over, I remove the lightening cable and then I'm able to kill the app, see the notification and reopen.

This doesn't work for you ?

dtkdt100 commented 1 year ago

I only try running release from Android studio. I will try via CLI and let you know.

Thanks you🙏

dtkdt100 commented 1 year ago

Thank you! It works with this command.

I will let you know when the package is finished.

Thanks again, great work @gdelataillade

dtkdt100 commented 1 year ago

@gdelataillade https://pub.dev/packages/notification_when_app_is_killed