notification-triggers icon indicating copy to clipboard operation
notification-triggers copied to clipboard

Geolocation trigger

Open dacuan opened this issue 5 years ago • 6 comments

Hi all.

I love notification triggers. This feature really helps to move PWA forward. Is there any plan for geolocation triggers implementation?

dacuan avatar Apr 29 '20 19:04 dacuan

Great idea. A good way to implement Geo-Fencing! This will make many local businesses very happy and more prone to adopt progressive web apps.

docluv avatar May 14 '20 15:05 docluv

Can't wait for the full implementation. I am intending to build an offline PWA that will prompt a user to carry out an activity at a particular location, which ll be monitored without having to build an android app. When a user allows notification, can it be made to generate a unique ID sort of, for the user, that can be sent to the backend when the user comes online?

hephzaron avatar Jul 29 '20 05:07 hephzaron

Actually I figured out how to leverage geo-fencing in a PWA. I have not had time to really dig into the technique yet, but it could be used to promote anything really, including add your PWA.

You need to use the Google and Apple wallet services. As a consumer you can register your credit cards, loyalty cards and more. You can also opt into promotions from vendors/businesses that use the service.

Through this service you can configure geo-enabled notifications. When the subscribed consumer enters the fence they will receive the notification.

From there you could promote a link to encourage the user to install your PWA.

docluv avatar Jul 29 '20 10:07 docluv

@docluv You are right. It is possible to use Apple Wallet and Google Pay services for geo-fencing. Few limitations I know:

  1. Only 10 locations can be handled by one virtual card (Loyalty, Offer etc.)
  2. Notification will appear on Lock Screen in 100m (Apple) and 150m (Google) distance to location. No customization available.
  3. Notification UI customization is poor
  4. User have to install virtual card on phone to receive push notifications

dacuan avatar Jul 29 '20 10:07 dacuan

@dacuan These limitations are discouraging.

  1. My intention is to harness the power of service worker, cache, indexedDB and geolocation API. lightweight data with lat, long and files will be downloaded when the user is online in case of update. All other functions will be handled by the service worker. So user can get notifications on a specific task to be done when within the location.
  2. As long as the user has a chrome browser, it should work seamlessly.
  3. A unique ID will be generated for each user, which will be fetched automatically when the user comes online.
  4. Every notification received will be registered against the data and sent to the server when there is a connection.

hephzaron avatar Jul 30 '20 13:07 hephzaron

So on the wallet notification API/service. For the project I am working on (not a business marketing app) the notifications need to be made within 30 seconds since it is an emergency notification service. So the wallet path is not viable since there is too much latency :(

docluv avatar Aug 26 '20 15:08 docluv