doublesymmetry / react-native-track-player

A fully fledged audio module created for music apps. Provides audio playback, external media controls, background mode and more!
https://rntp.dev/
Apache License 2.0
3.18k stars 981 forks source link

Color & icons being set in updateOptions() not working #2211

Closed thinhtt264 closed 4 months ago

thinhtt264 commented 7 months ago

I even edited directly into the red native lib but it still doesn't work, any body can use it?

    val accentColor = Color.RED
    val smallIcon = BundleUtils.getIconOrNull(this, options, "icon")
    val pendingIntent = PendingIntent.getActivity(this, 0, openAppIntent, getPendingIntentFlags())
    val notificationConfig = NotificationConfig(buttonsList, accentColor, smallIcon, pendingIntent)

    Log.d("test", notificationConfig.toString())

    player.notificationManager.createNotification(notificationConfig)
thinhtt264 commented 7 months ago

Icon also not working

TrackPlayer.updateOptions({

    capabilities: [
      Capability.Play,
      Capability.Pause,
      Capability.SkipToNext,
      Capability.SkipToPrevious,
      Capability.Stop,
    ],

    compactCapabilities: [Capability.Play, Capability.Pause],
    notificationCapabilities: [
      Capability.Play,
      Capability.Pause,
      Capability.SkipToNext,
      Capability.SkipToPrevious,
      Capability.Stop,
    ],

    android: {
      appKilledPlaybackBehavior:
        AppKilledPlaybackBehavior.StopPlaybackAndRemoveNotification,
    },

    icon: require('src/assests/images/Spotify_Logo.png'),
    nextIcon: require('src/assests/images/Spotify_Logo.png'),
    color: 0xffff0000,
  });
lovegaoshi commented 7 months ago

icons are known to not work unless in prod. colors i have no idea

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 4 months ago

This issue was closed because it has been stalled for 7 days with no activity.