Search code examples
flutteraudio-service

How to show currently playing audio on Android with audio_service?


I've been using this package for couple of apps already. Always used one-isolate version.

On the iOS, I see this package successfully registers the audio on control center but on Android, I don't see control buttons anymore. Only a notification about that app being running on the background. Did I miss something in the setup or is it a bug?

enter image description here


Solution

  • When I'm initiating the service, I was overriding the androidNotificationIcon with an incorrect value.

      androidNotificationIcon: 'mipmap/launcher_icon'
    

    Probably because I've copied pasted some code from my previous application. I removed this line now and it points to the its default value.

    {String androidNotificationIcon = 'mipmap/ic_launcher'}
    

    Everything works.