ghenry22 / cordova-plugin-music-controls2

A Cordova plugin displaying music controls in notifications (cordova-plugin-music-controls)
MIT License
59 stars 60 forks source link

Notification icon is no longer shown in the Status Bar (Android) #95

Open NorthFred opened 1 year ago

NorthFred commented 1 year ago

With the implementation of the Android 11+ media style notification, the application's (custom) notification icon no longer gets shown in the status bar.

romain25 commented 1 year ago

Hello, I have the same issue, do you have any idea ?

romain25 commented 1 year ago

Hello, I find solution.

I start and refresh MusicControls.create with isPlaying with false. So when I change cover or song information, musiccontrol pass Play to Stop and notification disapear.

So I store in variable, when I start, play, pause status of isPlaying


// Begin
var isPlayingStatus = false;

// Play
isPlayingStatus = true;

// MediaError 
// Stop
isPlayingStatus = false;

// Refresh and create MusicControl
MusicControls.create({
...
            isPlaying   : isPlayingStatus,                          
....

        }, this.MusicControllerSuccess, this.MusicControllerError);

I hope this help people ;)