-
Notifications
You must be signed in to change notification settings - Fork 255
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 notifcation player doesn't go away #49
Comments
Thanks for the tip, feel free to submit a PR if you want ;) |
@samyachour I would be very interested in a more detailed explanation of the fix. I'm faced with the same issue and my Android knowledge is lacking to find the fix myself. |
@IndrekV no problem. I don't have much android knowledge either, so forgive my lack of depth in the explanation. But essentially we are creating a service (a background task) that will delete all notifications from the app when it's closed via the app switcher.
Now we have a service that will remove all notifications once the app is removed from the app switcher. You probably should rename the service for code clarity. The next step is simply iniating the service when the app starts.
This calls our service when the app starts, as well as the rest of the stuff we need to call. Then just add these import lines to MainActivity.java and you should be good.
Let me know if you have any more questions! EDIT: Added step
|
@samyachour Thank you for the fast response. I tried the your suggested solution and sadly it did not work for me. I looked a bit more into the code and found that the issue was even simpler. I created PR to fix this issue #74. I hope @tlenclos merges this fast as it is pretty annoying bug. |
@tlenclos this is not fixed. #74 doesn't fix the problem for me. But the solution @samyachour propose works perfect. |
@samyachour 3- Finally add the service in the app's AndroidManifest.xml (android/app/src/main) like this: |
@nusson added! Haven't looked at this in a while, but your suggestion makes sense. |
When I close my app with app switcher (in android) the notifcation player doesn't go away, and the little 'x' button doesn't work.
I found a workaround though, just for everyone's information. In my android project I made a new service and used the method onTaskRemoved which gets called when the app is closed from the app switcher.
In that method I cancelled all the notifcations for the app, and voila! Will give more info if requested.
The text was updated successfully, but these errors were encountered: