4

I have an idea for an app, where I need to implement geofencing. In other words, I want to specify different places, and when a user gets near it, I want it to make an HTTP request to my server.

I'm still learning Swift, and I do know Java, but I would prefer to develop this with NativeScript and also Angular 2.

Does anyone know if this is possible?
If yes, do you know any plugins or have any links that can help me move forward with my project?

Thanks in advance

Sreehari
  • 5,621
  • 2
  • 25
  • 59
Anders Gerner
  • 775
  • 9
  • 27

2 Answers2

1

You should be able to as long as you have reference to a collection of GeoJSON. Using the nativescript-geolocation plugin you can also access the device's GPS. Convert the location object to GeoJSON and then determine if the GeoJSON Point is within a GeoJSON Polygon shape and you have geofencing.

References that should help get you going:

https://docs.nativescript.org/hardware/location -NativeScript documentation on accessing device gps natively.

http://geojson.org -GeoJSON specification

ttp://geojson.io (Sorry I can't post more links so I broke this one) -GeoJSON shape generator

Don
  • 61
  • 5
1

You could try https://github.com/transistorsoft/nativescript-background-geolocation-lt but the Android implementation is not free.

Both iOS and Android have native APIs for setting up geofences so it should be possible to use those directly.

Tamlyn
  • 22,122
  • 12
  • 111
  • 127