suragch / flutter_audio_service_demo

Companion project for Flutter audio_service tutorial
https://suragch.medium.com/background-audio-in-flutter-with-audio-service-and-just-audio-3cce17b4a7d?sk=0837a1b1773e27a4f879ff3072e90305
MIT License
57 stars 28 forks source link

Notification Icon doesn't Show up in Notification Drawer & Lock Screen #7

Closed gOzaru closed 2 years ago

gOzaru commented 2 years ago

Plugin: audio_service: ^0.18.0-beta.0

Expected Behavior: Notification Icon should be also displayed inside the Notification Drawer and Lock Screen. But, unfortunately, nothing shows up. It is blank. The only place that it gets displayed is on Status Bar.

I forked your repository and modified the:

  return await AudioService.init(
    builder: () => MyAudioHandler(),
    config: AudioServiceConfig(
      androidNotificationChannelId: 'dev.suragch.flutter_audio_service_demo.channel', <-- This
      androidNotificationChannelName: 'Audio Service Demo',
      androidNotificationOngoing: true,
      androidStopForegroundOnPause: true,
      androidShowNotificationBadge: true, <-- This
      androidNotificationIcon: "mipmap/ic_launcher", <-- This
    ),
  );

I added this in app > build.gradle shrinkResources false

I added this in android > app > src > main > AndroidManifest.xml inside tag :

        <service android:name="com.ryanheise.audioservice.AudioService">
          <intent-filter>
            <action android:name="android.media.browse.MediaBrowserService" />
          </intent-filter>
          <meta-data
              android:name="dev.suragch.flutter_audio_service_demo.channel"
              android:resource="@mipmap/ic_launcher"/>
        </service

The minimal repository that can be reproduced is on this link: Forked @suragch Repository

gOzaru commented 2 years ago

It is solved now. Check this issue that I closed. It seems that the Notification Icon in Notification Drawer and Lock Screen only display the album image, not the application icon.

https://github.com/ryanheise/audio_service/issues/810

suragch commented 2 years ago

Thank you for leaving an update.