我必须推送通知给所有使用我的网站OpenFin的用户。根据OpenFin文档,他们已经提供了应用程序接口,用于在按钮单击之类的事件上发送桌面通知。但是如果OpenFin应用程序是空闲的,我们需要发送通知,那么我如何实现这一点呢?
我在OpenFin提供的这个site上演示了这个示例。
有人可以用javascript编写推送通知的示例代码吗?
发布于 2020-04-12 18:55:01
链接中提供的示例已过时,因为它使用旧的Openfin API。我建议您使用最新的Openfin Notification API通知应用编程接口
fin.Notification.create({
url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Notification.create.html',
timeout: 3000
}).show().then(() => console.log('Notification created')).catch(err => console.log(err));https://stackoverflow.com/questions/59819066
复制相似问题