首页 > 解决方案 > 在 flutter_local_notifications 上禁用振动

问题描述

我正在使用flutter_local_notifications为我的应用程序提供通知,我想在没有任何声音或振动的情况下显示它们。当我为 Android 配置 ChannelSpecifics 时,我专门设置为 falseenableVibration

var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
        'id', 'name', 'description',
        importance: Importance.Max,
        priority: Priority.High,
        ongoing: true,
        enableVibration: false);

但无论如何,我仍然得到振动。有没有其他方法来配置这个?

标签: flutternotifications

解决方案


一旦指定了通知通道的设置,它在该通道的整个生命周期内保持不变。我怀疑您在enableVibration设置为 true时重复使用了相同的频道 ID


推荐阅读