我可以使用自定义音调,flutter_local_notifications
但我希望我的用户能够从他/她的移动设备中选择通知音,因为 WhatsApp 允许您从本地存储中选择任何通知声音。
有什么办法吗?如果您想查看代码,请告诉我,我会更新更多。
showNotification() async {
var android = AndroidNotificationDetails('id', 'channel ', 'description',
priority: Priority.high,
importance: Importance.max,
playSound: true,
sound: RawResourceAndroidNotificationSound('xperia'));
var iOS = IOSNotificationDetails(
sound: "xperia.mp3",
);
var platform = new NotificationDetails(
android: android,
iOS: iOS,
);
await _flutterLocalNotificationsPlugin.show(
0,
widget.serviceName,
'Service has been subscribed successfully!',
platform,
payload: 'xperia',
);
}