Geofencing on PWA?

I want my website to access the geofencing api even when the user close the browser.

Would https://ionicframework.com/docs/native/geofence/ help me to achieve that? Does Ionic Native mean I have to package my app as a native mobile app (to be downloaded from app store) in order for it to work?

Is there any other way of achieving what i want (geofencing/geolocation info when browser is closed) on a PWA?

Hi

Native plugins wont necessarily work unless they support the browser platfrom

Check https://developers.google.com/maps/documentation/javascript/examples/map-geolocation

As chrome offers api to get the location

Not sure if and how this works on other browsers

Rgdz

Tom

That API from Chrome doesn’t work when browser is closed.
How do i check if a native plugin supports the browser platform?

Hi

You are looking for background processing in pwa (with browser closed)? Sounds almost like a contradiction

Check the cordova plugin doc per plugin to see if it supports browsers.

But mind you that there arent many (intereting) plugins that do so.

So you may wind up concluding that pwa isnt going to do the trick for you

Rgdz

Tom

2 Likes

I don’t think geofencing is possible in a browser app, especially not when the browser is not even open.

There was a specification https://w3c.github.io/geofencing-api/ but seems like no browser implemented it.

1 Like