0

I use Audio Service to allow audio files to play in the background. Everything works fine except for the icon in the Lock screen (Android only, iOS work fine). In the documentation I couldn't find how to implement it. To implement personal icons with push Notifications I use AndroidManifest.xml. But here I don't know how I can do it. I show below how the window results in the Lock screen. I thank you for any help.

The icon is a circle black

csacchetti
  • 63
  • 5

1 Answers1

0

The icon can be set via the androidNotificationIcon setting in the AudioServiceConfig you pass into init. It is documented here:

String androidNotificationIcon

The icon resource to be used in the Android media notification, specified like an XML resource reference. This should be a monochrome white icon on a transparent background. The default value is "mipmap/ic_launcher".

If you are already using this option to set the icon but your icon is not rendering correctly, it is probably because the icon you supplied did not follow the monochrome requirement.

Ryan Heise
  • 2,273
  • 5
  • 14
  • Thank you @Ryan Heise. In fact in the default position I had an icon with no requirements. The one with requirements that I was using for push notifications was in a different location. By correcting the path it is now seen regularly. One thing remains though. While for push notifications I have the option to set a color of the icon, which otherwise appears black and white, here I don't know how to set the color of the icon and as a result it appears as black and white but I would like it blue. Is there any way to change the color? Thanks Ryan – csacchetti Aug 21 '23 at 19:44
  • No, the icon is required to be a monochrome white icon (as I quoted from the documentation). – Ryan Heise Aug 22 '23 at 01:59
  • So isn't it possible, as is the case with push notification icons to have a single color icon that you can choose? Also in the case of push notifications you need a monochrome white icon but then there is the possibility to set a property that makes you choose the unique color with which you want to show this icon. You say this in audio service notifications is not possible? Because it seems strange to me since the logic of push notification icons is very similar to this. Thanks Ryan – csacchetti Aug 22 '23 at 06:34
  • For exemple in push notification I have to set the color in AndroidManifest.xml like this: – csacchetti Aug 22 '23 at 06:53
  • The accent colour is set in `AudioServiceConfig.androidNotificationColor`. – Ryan Heise Aug 22 '23 at 11:37
  • Sorry @Ryan Heise but maybe I misunderstood. I looked in the AudioServiceConfig properties but androidNotificationColor does not exist. There is the notificationColor property but I tried assigning a color to this property but nothing changes in icon color, remain in black and white. What is it that I misunderstood? Thanks always – csacchetti Aug 24 '23 at 08:19
  • If there is black in your icon, it is possible that what you misunderstood is "monochrome white". – Ryan Heise Aug 24 '23 at 14:19