florent37 / Flutter-AssetsAudioPlayer

Play simultaneously music/audio from assets/network/file directly from Flutter, compatible with android / ios / web / macos, displays notifications
https://pub.dartlang.org/packages/assets_audio_player
Apache License 2.0
755 stars 360 forks source link

setOnlyAlertOnce for Android Notifications #316

Open Ameggg opened 4 years ago

Ameggg commented 4 years ago

Could you add the ability to decide whether or not to repeatedly alert the user that the notification metas have been updated on Android.

Useful StackOverflow Post: https://stackoverflow.com/a/15538209/13835434

I do not want the notification to appear every time the metas are updated:

example

Ameggg commented 4 years ago

I was able to modify the plugin locally and achieved the desired feature:

Edit File:

android/src/main/kotlin/com/github/florent37/assets_audio_player/notification/NotificationService.kt

Line 288:

added .setOnlyAlertOnce(true) after .setContentText(action.audioMetas.artist)

I'm still not an expert at PR and linking Flutter to Native code :)

May someone kindly explain how to implement the above feature: (give the programmer the option to repeatedly alert user when notification meta data updated or not)

elmissouri16 commented 4 years ago

yes will great to have a solution for it its work fine on some devices others each time you switch a song its popup again