Skip to content

@capgo/capacitor-proximity

Enable native proximity monitoring so your app can react when the device is held to the ear, covered by a hand, or placed face down.

@capgo/capacitor-proximity wraps native proximity monitoring so VoIP, voice note, and support call screens can react when the device is near a face or hand. Enable monitoring during a call flow and disable it when the user leaves the screen.

On iOS the plugin toggles UIDevice proximity monitoring. On Android it listens to TYPE_PROXIMITY and dims the window while the sensor is covered.

PlatformSupportNotes
iOSYesUIDevice proximity monitoring
AndroidYesProximity sensor with screen dimming
WebNoNot available
  • enable - Enable proximity monitoring.
  • disable - Disable proximity monitoring.
  • getStatus - Get the current sensor availability and plugin enabled state.
MethodDescription
enableEnable proximity monitoring.
disableDisable proximity monitoring.
getStatusGet the current sensor availability and plugin enabled state.
getPluginVersionGet the current native plugin version.

This reference is synced from src/definitions.ts in capacitor-proximity.

Keep going from @capgo/capacitor-proximity

Section titled “Keep going from @capgo/capacitor-proximity”

If you are using @capgo/capacitor-proximity to plan native plugin work, connect it with Using @capgo/capacitor-proximity for the native capability in Using @capgo/capacitor-proximity, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, and Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives.