barometer-plugin
v0.0.4
Published
The Barometer Plugin allows developers to access barometric sensor data on iOS devices within their Capacitor or Cordova applications. By utilizing the Core Motion framework, the plugin retrieves altitude information based on atmospheric pressure. Develop
Downloads
186
Maintainers
Readme
barometer-plugin
The Barometer Plugin allows developers to access barometric sensor data on iOS devices within their Capacitor or Cordova applications. By utilizing the Core Motion framework, the plugin retrieves altitude information based on atmospheric pressure. Developers can integrate this functionality into their applications to gather real-time altitude data, enabling various use cases such as altitude tracking, elevation-based features, and environmental monitoring. The plugin provides a simple and efficient way to incorporate barometric sensor capabilities into iOS applications, enhancing their functionality and user experience.
Install
npm install barometer-plugin
npx cap sync
API
getPressure()
getPressure() => Promise<{ pressure: number; }>
Returns: Promise<{ pressure: number; }>
For IOS, enable the barometer sensor in the Xcode project settings. Add the following keys to the Info.plist file:
<key>NSMotionUsageDescription</key>
<string>We use the barometric sensor to collect atmospheric pressure data</string>