flutter - 在 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);
但无论如何,我仍然得到振动。有没有其他方法来配置这个?
解决方案
一旦指定了通知通道的设置,它在该通道的整个生命周期内保持不变。我怀疑您在enableVibration设置为 true时重复使用了相同的频道 ID
推荐阅读
- reactjs - 使用过滤器和挂钩的搜索功能
- kotlin - 未解决的参考:Github 上 Kotlin 和 Gradle 的 javafx
- asp.net-mvc - 是否可以在单个 _Layout.cshtml 中逐行显示多个局部视图?
- reactjs - 如何通过动态导入开始工作 React.lazy/Suspense?
- graphene-django - 从 Uvicorn 运行时,Django 石墨烯 GraphiQL 页面未加载
- html - BBEdit 查找模式并删除整个表格
- kubernetes - 为什么 ipvs 调度程序不断回到 rr?
- javascript - nuxt.js 在 vue.js 组件中获取默认头部
- javascript - 在 JavaScript 中展平 JSON 对象
- javascript - html5 视频播放列表有视频之间的差距