dtkdt100 / notification_when_app_is_killed

Push notification when app is killed

Home Page:https://pub.dev/packages/notification_when_app_is_killed

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how does this work?

jtkeyva opened this issue · comments

commented

what does this do exactly and how do i get a notification?

Hi, @jtkeyva
This is still a concept package, it is not fully working yet :(

I will write in the README, sorry.

I will let you know when it is working, currently only android has been tested and working.

If you want to use it anyway please look at the example

commented

ok thanks. i'm on ios and curious as to how it worked and what it did. intruiging title. like how do you get a notification if the app is not open or responding?

i look forward to the progress :)

Hi, this package is fully working now. Plesase checkout version 0.0.2.

This package developed with this acrticle https://medium.com/@gdelataillade/displaying-a-notification-when-your-flutter-app-is-killed-4ef25cc3f193 and with gdelataillade's help

commented

thank you it's working now.
EDIT:
Sometimes it's working?
Hmm. The repo from the article works everytime. But I can't figure out why yours only worked once for me

Interesting, not sure why it is not working every time.
Each time when you open the app you tap the "active service" button?
Any special behavior that you notice when the notification doesn't appear?

commented

correct. no i don't notice anything. but your buttons are kinda awkward and the true false indicator is a bit confusing as well. i suggest making it a switch like as in the example to make it obvious that the feature is on. not sure what that true/false thing is showing.

i can do some more testing if you can clean up that ui a bit to be certain

Ok, I will change it to a toggle, good idea. I will let you know when it is finished

Thank you very much 🙏

@jtkeyva
Hi! I did change it to switch widget. I notice something weird, on my iphone 11 it works every time (i tried 10 in a row) but on my iphone 6s it works barly once.

Witch iphone do u use?

commented

12 Pro

That other example from the tutorial works every time on it. And ya yours was working like once out of 10

I will look at the article's example deeply and I will try to understand what is causing the issue and fix it.

I think I fixed it. The problem was that the onKill function is not overrided the main onKill function in the AppDelegate.swift.

Checkout version 0.0.4

commented

cool, good job! yes now it works every time. but it seems to be a different notification? before it was silent with a white background. now it plays a sound and has the frosted background. is this intentional? if so, why?

now yeah a readme of how to implement this into an app would be helpful as i'm sure there are some special instructions.

thank you

commented

just saw this. i claime it can notify on app termination or kill. could be interesting to see what they did
https://pub.dev/packages/awesome_notifications

Yes, the sound and vibration are intentional. You can edit these settings with

ArgsForIos argsForIos = ArgsForIos(
  interruptionLevel: InterruptionLevel.critical,
  useDefaultSound: true,
);

Regaurding awesome_notifications, I don't think it is excaly the same behavior as I wanted. "Store events to be fired when app is on Foreground"

image

commented

Got it.

This is in the readme FYI:
Notifications could be created at any moment (on Foreground, Background or even when the application is terminated/killed).

Yes, but they probably don't have a listener to when the app is killed like we do (my package overrides the "onTeminate")