简体   繁体   English

在 flutter_local_notifications 上禁用振动

[英]Disable vibration on flutter_local_notifications

I'm using flutter_local_notifications to provide notifications for my application and I want to show them without any sound or vibration.我正在使用flutter_local_notifications为我的应用程序提供通知,我想在没有任何声音或振动的情况下显示它们。 When I'm configuring the ChannelSpecifics for Android I specifically set to false enableVibration当我为 Android 配置 ChannelSpecifics 时,我专门设置为 false enableVibration

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

But anyway I'm still getting the vibration.但无论如何,我仍然收到振动。 Is there any other way to configure this?有没有其他方法可以配置它?

Once the settings for a notification channel has been specified, it remains the same for the entire lifetime of that channel.一旦指定了通知通道的设置,它在该通道的整个生命周期内都保持不变。 I suspect you've reused the same channel id back when enableVibration was set to true我怀疑当enableVibration设置为 true 时,您已经重用了相同的频道 ID

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM