Proximity Sensor Plugin is a reusable OutSystems 11 mobile plugin that provides access to the device's proximity sensor. It allows mobile applications to check proximity sensor availability, enable or disable the sensor, and retrieve the current proximity state.
The plugin is useful for mobile scenarios where an application needs to detect whether an object is near the device's proximity sensor. For example, proximity detection can be used in applications that need to respond to the physical presence of an object near the device.
CheckProximityAvailabilityChecks whether the proximity sensor plugin is available in the current mobile application and returns an availability status.
EnableProximitySensorEnables the device proximity sensor and starts proximity monitoring.
DisableProximitySensorDisables the device proximity sensor and stops proximity monitoring.
GetProximityStateRetrieves the current proximity state and indicates whether an object is detected near the proximity sensor.
The proximity state is returned as a Boolean value:
A typical implementation can follow these steps:
Applications can periodically call GetProximityState when they need to monitor proximity changes.
The underlying Cordova plugin supports:
The component has been tested on Android. iOS support is provided by the underlying Cordova plugin and should be validated on the target iOS environment before production use.
When the proximity sensor detects an object nearby, the device may automatically dim the screen or change screen interaction behavior. This behavior is controlled by the device's operating system and may vary depending on the device and platform.
A demo application is included to demonstrate how to check sensor availability, enable and disable the proximity sensor, and retrieve the current proximity state on a mobile device.
This component is intended for OutSystems 11 mobile applications running on physical devices with a supported proximity sensor. Proximity sensor availability and behavior may vary depending on the device hardware and operating system.