Proximity sensor


Two weeks ago I decided to develop an app using NativeScript, and I’m still new to it and still examining it.

I couldn’t find any reference or plug-ins for the built-in for reading the proximity sensors in iPhone or modern Android devices, and this is crucial for my project.

  1. Is there a plugin for nativescript that I can use in urder to read the proximity sensor (for detecting when the phone is close to the ear)?
  2. If there isn’t, can you please refer me to a starter guide for writing platform-specific native-code for such a plugin? (How to write plugins by yourself)



Kinvey has similar options.


By ‘proximity’ I meant to check if the phone is close to your ear, and not to check nearby places. So Kinvey project is not a good choice unfortunately.


In that case you may try the SensorEventListener.


Thank you.
This is a native Android hardware interface. How can I access it through NativeScript?
Where can I learn how to write plugins for NativeScript?