当更改数据库中的列值时,如何发送Web推送通知?

发布于 2025-02-01 14:08:20 字数 787 浏览 2 评论 0原文

在过去的两天中,我一直在研究Web推送通知,因为这是一个新主题,也是我第一次在开发中取得联系。

我发现了许多完成的Web推送通知服务,如 wonderpush onsignal 。到目前为止,关于这些服务,我大多对Oneignal以及他们所做的事情引起了人们的关注,以及他们如何通过启用推送通知来推动通知本身进行整洁的用户界面。

问题是,我无法弄清楚这些是否会符合我的要求,因为当数据库中的列更新时,我需要触发操作(显示推送通知),但事实是,每个人都不相同。情况正在以下情况下,我有客户的汽车数据库,当然,一个客户可以拥有多辆车,而汽车只能拥有一个所有者,并且有“ carstatus”列可以具有值done,, in process 和hold。因此,我必须修改Web推送通知要执行以下操作:假设Carstatus的默认值是 ,当它更改以便说完成时,我会想要向该特定汽车所属的用户发送推送通知。

我的第一个问题是,它是可以通过Onesignal实现的,还是我必须为此编写自定义代码?

我的第二个问题是,如果我必须为此编写自定义代码,除了MDN外,您是否在Web推送通知上有任何良好的资源,因为我发现它对我的情况并没有太有用,而且似乎是一般的东西。

For the past 2 days I've been researching about web push notifications as it is a new topic and something that I am getting in touch for the first time in development.

I've found many done web push notification services as Wonderpush and OneSignal. So far regarding to these services, I've been mostly intrigued by OneSignal and what they've done and how they've done neat user-interface from enabling push notification to push notifications itself.

The thing is, I can't figure out if these will go along with my requirements, as I need to trigger action (show push notification) when column in database is updated, but the thing is, it's not same for everyone. The situation is following, I have database of customer's cars and of course one customer can have multiple cars and car can have only one owner and there's column "carStatus" which can have value Done, In Process and On Hold. So, I'd have to modify Web Push Notification to do following: Let's say default value of carStatus is On Hold, when it changes to let's say Done, I'd want to send push notification to user which that particular car belongs to.

My first question, is something like that even achievable with OneSignal or I would have to write custom code for it?

My second question, if I'd have to write custom code for this, do you have any good resources on Web Push Notification except from MDN as I don't find it way too useful for mine case and it seems like general stuff.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文