将渐进式Web应用程序链接到信标以触发事件 [英] Linking a progressive web app to a beacon to trigger a event

查看:102
本文介绍了将渐进式Web应用程序链接到信标以触发事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个渐进式Web应用程序,在该应用程序中,我将使用信标来传输eddystone URL.一旦电话捕获到Eddystone URL并单击通知(使用物理网络),它将打开Progressive Web应用程序. 我的问题是,有没有一种方法可以将Web应用程序与信标集成在一起,以便当电话进入某个信标的范围时,它会触发特定于该事件的事件.例如:如果我去公园,长凳上有一个信标,则PWA应该知道该长凳上的信标,并应触发相应的动作. 谢谢你.

I'am trying to make a progressive web app where I will use beacons to transmit the eddystone URL. As soon as the phones catch the Eddystone URL and click on the notification(using physical web) it will open the Progressive web app. My question is that is there a way to integrate the web app with beacons such that when the phone comes in the range of a certain beacon, it triggers an event specific to that. For eg: if i go in a park and there is a beacon on a bench, the PWA should know be aware of the beacon on that bench and accordingly actions should be triggered. Thank you.

推荐答案

Eddystone-URL信标只能发送URL.仅当用户在其通知栏上向下滑动时,移动设备才检测到这些信号.当用户点击它时,这是唯一一次将他们带到网站(请注意关键字:).除非您创建通过服务工作者将站点和移动设备连接起来的后端服务,否则移动设备和信标之间没有任何连接.

Eddystone-URL beacons could only do is transmit the URL. The mobile device is only detecting these signals only when a user has swiped down on their notification bar. When the user has tapped on it, that's the only time they are taken (take note of keyword: taken) to the site. There is no connection between the mobile device and the beacon unless you create a backend service that connects the site and the mobile device through service workers.

PWA不是一个应用程序,它仍然是一个使用现代Web技术的网站(如果受浏览器支持).通知是被动通知,意味着用户只会在需要时才注意到它.除非您为此构建了一个应用程序,否则在附近时它不会振动也不发出声音. 这就是为什么他们想出这种方法的原因,因为应用程序通知已经具有侵入性.

PWA is not an app, its still a website that utilises the modern web technologies (if supported by the browser). The notifications are passive notifications meaning, users will only notice it if they need it. It will not vibrate nor give an audible sound when you are near one unless you build an app for this. This is why they came up with this method because app notifications were already intrusive.

这篇关于将渐进式Web应用程序链接到信标以触发事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆