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.
2 Answers
Simply configure each beacon with a unique url suffix that matches the location where they are installed. If your web app is at:
http://mywebapp.com/path
Then the URL configured for the beacon on the park bench might be:
http://mywebapp.com/path?beacon_id=park_bench
You may need to use a URL shortening service to make such URLs small enough for Eddystone-URL.
You will also need to build your web app to detect which URL suffix launched it and take appropriate action.

- 63,876
- 14
- 121
- 204
-
consider a restaurant, what if an already opened PWA using physical web needs to identify table according to the beacon attached to table transmitting signal. I found requestdevice and requestLEScan but they helped in pairing not displaying notification/content/trigger event – Divye Shah Jun 10 '17 at 17:30
-
Be careful to explore the limitations of Eddystone-URL with web apps before going too far here. There are no bluetooth LE device scanning APIs you can run inside a web browser container on a mobile device. As of June 2017, you must have a native Android app to do this. Newer versions of Chrome for Android and Google Play Services (Nearby) can send notifications when Eddystone-URL beacons are detected, and tapping them will launch a browser-based web app. That is the type of solution I was describing in my answer. – davidgyoung Jun 11 '17 at 21:12
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 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.

- 989
- 6
- 23