How do I set a GPS check location on the Ionic 2?

I am developing an application on Ionic 2 and I would like to implement a limitation where some functionality can only be used if the user is GPS located at a location or within a range set in my database. For example: a user can only click on an item if it is on X. I was recently new to Ionic 2 and how GPS check works.

What would be the best approach to meet this constraint?

+3


source to share


1 answer


What you are trying to accomplish is called "geofencing". Typically, your application will get the location and then check if the coordinates of the last known location are with a set of predefined areas, usually in a radius around some other coordinate.

Some mobile sdks provide an implementation for geoprocessing, however since you are using ionic2 you might have to look at the Cordova implementations.



Luckily, someone has added a geoprocessing example with ionic2 and you should definitely take a look.

+2


source







All Articles