easazade / android_long_task

android long task is a flutter plugin to run dart code in an android foreground service with simplicity
Apache License 2.0
16 stars 6 forks source link

Service notification not visible on Android 13(API level 33) #13

Closed Galeen-Bidpath closed 1 year ago

Galeen-Bidpath commented 1 year ago

Hi, thanks for your great service. I have been used it on 2 applications already and now planning on 3th one :) . While developing a POC on the 3th one noticed that the notification for the service is not visible on the Pixel 6 phone that runs on android 13. Quick check in the documentation shows that there are some new restrictions : https://developer.android.com/guide/components/foreground-services#notification-immediate

I think a quick fix will be to add a button on the notification that should show the notification. Maybe that button could be to stop the service, which will be great user experience(if we can handle that click on flutter side, do our final work and stop the service).

For now my quick solution is to build against API 32, in that case shows the notification even on the PIxel

easazade commented 1 year ago

Hi @Galeen-Bidpath Thank you for reporting this. I will defenitly look into this issue.

hector1980 commented 1 year ago

Hi! I don't think this is a bug in the package. It seems that Android 13 (API level 33) needs that the user explicitly allows the app to access the notifications zone of the smartphone. Once this is done, notifications appear perfectly well (at least, in my case).