2

我正在开发颤振应用程序,我想启用通知声音。我已经集成了 FCM 并使用了 flutterLocalNotificationsPlugin。 应用设置中默认禁用此通知声音设置。 我必须启用此设置

var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
    'com.testApp', 'fcm', 'android',
    icon: 'notif_icon',
    color: Color(0xFFFFC33E),
    importance: Importance.max,
    priority: Priority.max,
    playSound: true,
    sound: RawResourceAndroidNotificationSound('slow_spring_board'),
    groupKey: 'com.testApp');
var iOSPlatformChannelSpecifics =
    new IOSNotificationDetails(threadIdentifier: 'com.testApp');
var platformChannelSpecifics = new NotificationDetails(
    android: androidPlatformChannelSpecifics,
    iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(
  0,
  notification.title,
  notification.body,
  platformChannelSpecifics,
  payload: json.encode(message.data),
);
4

0 回答 0