Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreground Service closes after app swiped up/closed from multitasking panel #59

Closed
fahidsarker opened this issue Jun 22, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@fahidsarker
Copy link

fahidsarker commented Jun 22, 2022

The plugin works fine when the app is focused or in the background. But once, once the app is closed by swiping up from the multitasking area, the notification is removed.

APP in Focus:
Screenshot_20220622-215224__01

App In Background but not closed:
Screenshot_20220622-215234__01

App Closed from muli-tasking view:
Screenshot_20220622-215240__01

Note: The white dot is the notification

Is this normal behavior? Shouldn't it keep the app alive even after swiped up?

Objective of the app: Prevent the app from being killed to ensure timely alarm firing by the android alarm manager

Device: Oneplus 7 - Android 11

@fahidsarker fahidsarker added the bug Something isn't working label Jun 22, 2022
@JulianAssmann
Copy link
Owner

JulianAssmann commented Jun 24, 2022

This is intentional behavior introduced by #10. As closing the app is an intentional action by the user, this intent has to be respected by apps. The isolate the app runs in should be killed either way, so keeping the foreground notification probably does not achieve the desired effect. See #28 for more.
I don't quite understand the reason you need the app running in the background in order for the alarm manager to work.

@fahidsarker
Copy link
Author

I see. Thank you for clarification.

The thing is Android probably kills my app process after it has been closed for few days. It is a prayer notification app, so notifying prayer time everyday and calculating the next time should continue happening even if user does not open the app for weeks. But, Alarm manager does not fire alarms on due time. Hence, I wanted to keep a process running to make sure it keeps running. Any help would be appreciated 🤠

@fahidsarker fahidsarker closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants