universal-tools / UTNotificationsFeedback

7 stars 0 forks source link

Scheduled notifications not working when APP is stopped #58

Closed yanufriev closed 7 years ago

yanufriev commented 7 years ago

We use this method, schedule a notification even using your demo-scene, then kill app and never get notifications. How should it work?

We are using this type of command Manager.Instance.ScheduleNotification(15, "Scheduled", "Notification", ScheduledNotificationId, null, "demo_notification_profile", 1);

yuriy-universal-ivanov commented 7 years ago

Hi @yanufriev ,

First of all, thank you for using UTNotifications!

I suppose you're talking about Android, aren't you? On Android, when you kill an app, the system also kills any of its background services and even alarms, which are used for scheduling notifications, so no notification can be shown until a user restarts an app or reboots the device - it's a designed by Google behaviour, the idea is if a user decided to force-stop (kill) an app, it should not disturb they anyhow. See also https://stackoverflow.com/a/16402016. It is only true if we speak about force-closing (=killing) an app (f.e. by swiping it away in the list of recent apps or in system settings), but not when closing the app [normally by finishing all its Activities](https://developer.android.com/reference/android/app/Activity.html#finish()). F.e. Unity finishes the main activity on Application.Quit(). So after normally quitting an application with Application.Quit(), you'll still be receiving scheduled (and push, if any) notifications. There are, unfortunately some exceptions: some Xiaomi and some ASUS devices (may be some more) are known to force-kill any application except of a built-in white list (mostly messengers) without Activities to save power and memory.

Hopefully I answered your question. If not, feel free to ask for any further support, I'll be happy to help.

P.S. Your account name looks pretty Russian. You may be interested to know that I speak Russian, if it's more convenient for you.

Best regards, Yuriy, Universal Tools team.

yuriy-universal-ivanov commented 7 years ago

Hi @yanufriev , Have my answer helped you? May I already close the issue?

yanufriev commented 7 years ago

Good evening, yes, please close it! Thank you for your prompt answer :) Sorry I didn't respond asap.

On 26 июня 2017 г., at 23:45, yuriy-universal-ivanov notifications@github.com wrote:

Hi @yanufriev , Have my answer helped you? May I already close the issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.