-
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 8.1 - invalid channel for service notification #393
Comments
@maerlynflagg try below command.
|
Have similar issues with Android 8.1 however re-adding the platform didn't resolve it. Looks like an update might be needed - maybe something like this? ([https://stackoverflow.com/questions/47531742/startforeground-fail-after-upgrade-to-android-8-1]) EDIT: thanks @writer0713 that version has the fixes, updating ForegroundService.java with the updates from that git fixed the issue! |
Dont works in Android >= 8 |
@writer0713 This fixed the crash issue, but background plugin stopped working :( |
Below changes in the cordova-plugin-background-mode worked for me. Crash issue is resolved as well as background plugin is working fine.
c) Replace keepAwake() method with below code:
Alternately, you can try #416 but do remember to add FOREGROUND_SERVICE permission in AndroidManifest |
thanks!!! Work Great!!! |
@brauliofreire is it still working fine on Android 8+ phones? |
yes! I made tests in android 8.1 and it is working fine!! |
@katzer FYI. I haven't tested @Bharat-Rayasam's solution yet but it can be useful for you to come up with stable solution. |
@Bharat-Rayasam Thanks for this great help 🥇 💯 |
I was able to solve it this way: irceline/aq-mobile-be#94 (comment) |
Any chance on this solution be added to the main repo code? |
@katzer any chance? |
I hope that this fix will be added to the main repo code |
@Bharat-Rayasam this was the best solution! My application now works like a charm! Thank you! I had to make a slight change though. |
did you do a merge request? :D |
@Bharat-Rayasam :- sir I tried ur code but is working only in some Android devices and all devices are version 9.i tested in Oppo F11pro,nokia, Samsung,but it's working only in Oppo Device another device I got same error.now what I do now sir plz help me? |
I couldn't find the .java file, could you tell me where to find it? |
Hi, You could add FOREGROUND_SERVICE permission in your app once without updating AndroidManifest everytime you build the app. Add those lines to your config.xml to grant the missing permission:
|
i'm develope ionic app and there i'm used this plugin.
after opening my app and the app is loaded, i called the function "backgroundmode.enable()". after a short timespan app stopped with the issue:
invalid channel for service notification
after removing the usage of this plugin the app isn't stopped and runs all the time. all fine.
so, i checked this. i have added the plugin usage again and the exception came back. i removed it again, exception is gone
this is the full stacktrace, which is shown in Logcat (Android Studio):
The text was updated successfully, but these errors were encountered: