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

Unrestricted battery usage should be requested even without registrations #95

Open
p1gp1g opened this issue Nov 2, 2024 · 0 comments · May be fixed by #97
Open

Unrestricted battery usage should be requested even without registrations #95

p1gp1g opened this issue Nov 2, 2024 · 0 comments · May be fixed by #97

Comments

@p1gp1g
Copy link

p1gp1g commented Nov 2, 2024

If a user uses ntfy as a UnifiedPush distributor, the first registration will be received while ntfy is in background.

When an application is in the background, it cannot start a foreground service, unless the application has unrestricted battery usage rights.

Therefore, ntfy can't start the foreground service until it is opened again after the registration.

To fix that issue, this permission should be granted before receiving the first registration.


BTW, you can ask to ignore battery optimization for a package without asking users to go to the settings that way :
https://codeberg.org/NextPush/nextpush-android/src/tag/1.9.0/app/src/main/java/org/unifiedpush/distributor/nextpush/activities/MainActivity.kt#L120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant