是否可以在颤振中播放设备的默认通知声音?

sgo*_*n00 6 flutter

是否可以在 flutter 中播放设备(对于 android 和 ios)的默认通知声音?我试过了SystemSound.play(SystemSoundType.click);,没有任何作用。谢谢。

小智 5

您可以使用flutter_ringtone_player插件播放 Android 和 iOS 平台的默认通知声音,如下所示:

FlutterRingtonePlayer.playNotification();
Run Code Online (Sandbox Code Playgroud)