google / flutter.plugins

BSD 3-Clause "New" or "Revised" License
117 stars 55 forks source link

Notification custom button not work #47

Open stonega opened 4 years ago

stonega commented 4 years ago

I wanted to use my own style icon on notification bar in my app, so I created some custom button , but only forwardButton worked, the other button showed on notification bar, but not worked at all, maybe only support one custom on notification bar at the same time?

if (mediaEvent.customEventId == replay10ButtonId) { _forwardBackgroundAudio(-10.0); } else if (mediaEvent.customEventId == playnowButtonId) { _resumeBackgroundAudio(); } else if (mediaEvent.customEventId == forwardButtonId) { _forwardBackgroundAudio(30.0); } else if (mediaEvent.customEventId == pausenowButtonId) { _pauseBackgroundAudio(); }

final _pauseButton = AndroidCustomMediaButton( 'pausenow', pausenowButtonId, 'ic_stat_pause_circle_filled'); final _replay10Button = AndroidCustomMediaButton( 'replay10', replay10ButtonId, 'ic_stat_replay_10'); final _forwardButton = AndroidCustomMediaButton( 'forward', forwardButtonId, 'ic_stat_forward_30'); final _playnowButton = AndroidCustomMediaButton( 'playnow', likeButtonId, 'ic_stat_play_circle_filled');