-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Android 9 Fix #435
base: master
Are you sure you want to change the base?
Android 9 Fix #435
Conversation
FOREGROUND_SERVICE - https://developer.android.com/guide/components/services - katzer#435 REQUEST_IGNORE_BATTERY_OPTIMIZATIONS - To request user permission to ignore battery optimization
Please Merge it!! |
A merge would be appreciated! @okhiroyuki Until this is merged you can add the following snippet to the Android platform section in your config.xml: <config-file parent="/*" target="AndroidManifest.xml">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
</config-file> Full structure like this: <widget id="com.example.app" version="1.0.0">
[...]
<platform name="android">
<config-file parent="/*" target="AndroidManifest.xml">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
</config-file>
[...]
</platform>
[...]
</widget> |
@RafaelKr Thank you. It's a nice snippet!! |
If i implement this Code it is working fine. |
quick note: as per this comment by @martin-dufka, I had to include an entry in my
can anyone else confirm this behaviour? |
To add more information. I also had to add the WAKE_LOCK permission. I was also getting a "unbound prefix" error when I was trying to do the above work around. To fix that I followed these instructions:
|
+1 to merging this |
Background mode is not working for android 9. As it would not launch the Foreground service.
Based on android documentation FOREGROUND_SERVICE permission is required:
Also the service was not added correctly to the AndroidManifest.xml