如何在应用程序中禁用和启用通知?
我想制作一个基于焦点的应用程序,其中一旦用户进入焦点模式,没有社交媒体通知或任何形式的通知会打扰用户。
请帮我。
I want to make a Focus Based App where once the user enters in the Focus Mode, no social media notification or any kind of notification will disturb the user.
Please help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为,通过通知,您是指FCM通知,如果是这种情况,您可以简单地制作一个可以从后端添加/删除FCM令牌的开关。
有关更多信息,您可以检查 firebase消息传递软件包在PubDev上
I think by notifications you mean FCM notifications, if that is the case you can simply make a switch that will add/remove FCM token from the backend.
For more info you can check the Firebase messaging package on pubdev