---
description: Capacitor plugin to obtain the static air pressure (hPa) and altitude using the device's barometer sensor. Supports Android and iOS.
title: Capacitor Barometer Plugin for Android & iOS - Capawesome
image: https://capawesome.io/docs/assets/images/social/plugins/barometer.png
---

[ Skip to content](#capawesome-teamcapacitor-barometer) 

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  iOS ](#ios)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)
* [  Biometrics ](/docs/plugins/biometrics/)
* [  Bluetooth Low Energy ](/docs/plugins/bluetooth-low-energy/)
* [  Cloudinary ](/docs/plugins/cloudinary/)
* [  Contacts ](/docs/plugins/contacts/)
* [  Datetime Picker ](/docs/plugins/datetime-picker/)
* [  File Compressor ](/docs/plugins/file-compressor/)
* [  File Opener ](/docs/plugins/file-opener/)
* [  File Picker ](/docs/plugins/file-picker/)
* [  Firebase ](/docs/plugins/firebase/)
* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

* [  iOS ](#ios)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)

# @capawesome-team/capacitor-barometer[¶](#capawesome-teamcapacitor-barometer "Permanent link")

Capacitor plugin to obtain the static air pressure, which is measured in hectopascals (hPa).

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

We are proud to offer one of the most complete and feature-rich Capacitor plugins for barometer measurements. Here are some of the key features:

* 🖥️ **Cross-platform**: Supports Android and iOS.
* 📏 **Precise Measurements**: Get accurate air pressure readings in hectopascals (hPa).
* 🔄 **Real-time Updates**: Continuously monitor barometer changes with event listeners.
* 🔍 **Device Detection**: Check if barometer sensor is available on the device.
* 🔑 **Permissions**: Check and request barometer sensor permissions.
* 📊 **Additional Data**: Get relative altitude measurements.
* ⏱️ **Timestamps**: Each measurement includes precise timing information.
* 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.
* ⭐️ **Support**: Priority support from the Capawesome Team.
* ✨ **Handcrafted**: Built from the ground up with care and expertise, not forked or AI-generated.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |
| 7.x.x          | 7.x.x             | Deprecated     |

## Guides[¶](#guides "Permanent link")

* [Announcing the Capacitor Barometer Plugin](https://capawesome.io/blog/announcing-the-capacitor-barometer-plugin/)
* [Exploring the Capacitor Barometer API](https://capawesome.io/blog/exploring-the-capacitor-barometer-api/)

## Installation[¶](#installation "Permanent link")

This plugin is only available to [Capawesome Insiders](https://capawesome.io/insiders/). First, make sure you have the Capawesome npm registry set up. You can do this by running the following commands:

`[](#%5F%5Fcodelineno-0-1)npm config set @capawesome-team:registry https://npm.registry.capawesome.io
[](#%5F%5Fcodelineno-0-2)npm config set //npm.registry.capawesome.io/:_authToken <YOUR_LICENSE_KEY>
`

**Attention**: Replace `<YOUR_LICENSE_KEY>` with the license key you received from Polar. If you don't have a license key yet, you can get one by becoming a [Capawesome Insider](https://capawesome.io/insiders/).

Next, you can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-1-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-2-1)Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome-team/capacitor-barometer` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-3-1)npm install @capawesome-team/capacitor-barometer
[](#%5F%5Fcodelineno-3-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Proguard[¶](#proguard "Permanent link")

If you are using Proguard, you need to add the following rules to your `proguard-rules.pro` file:

`[](#%5F%5Fcodelineno-4-1)-keep class io.capawesome.capacitorjs.plugins.** { *; }
`

### iOS[¶](#ios "Permanent link")

#### Privacy Descriptions[¶](#privacy-descriptions "Permanent link")

Add the `NSMotionUsageDescription` key to the `ios/App/App/Info.plist` file, which tells the user why your app needs access to the user's contacts:

`[](#%5F%5Fcodelineno-5-1)<key>NSMotionUsageDescription</key>
[](#%5F%5Fcodelineno-5-2)<string>The app needs to access the motion activity.</string>
`

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-6-1)import { Barometer } from '@capawesome-team/capacitor-barometer';
[](#%5F%5Fcodelineno-6-2)
[](#%5F%5Fcodelineno-6-3)const getMeasurement = async () => {
[](#%5F%5Fcodelineno-6-4)  const { measurement } = await Barometer.getMeasurement();
[](#%5F%5Fcodelineno-6-5)  console.log('Pressure:', measurement.pressure, 'hPa');
[](#%5F%5Fcodelineno-6-6)  console.log('Relative Altitude:', measurement.relativeAltitude, 'm');
[](#%5F%5Fcodelineno-6-7)  console.log('Timestamp:', new Date(measurement.timestamp));
[](#%5F%5Fcodelineno-6-8)};
[](#%5F%5Fcodelineno-6-9)
[](#%5F%5Fcodelineno-6-10)const isAvailable = async () => {
[](#%5F%5Fcodelineno-6-11)  const result = await Barometer.isAvailable();
[](#%5F%5Fcodelineno-6-12)  console.log('Barometer is available:', result.isAvailable);
[](#%5F%5Fcodelineno-6-13)};
[](#%5F%5Fcodelineno-6-14)
[](#%5F%5Fcodelineno-6-15)const startMeasurementUpdates = async () => {
[](#%5F%5Fcodelineno-6-16)  Barometer.addListener('measurement', (event) => {
[](#%5F%5Fcodelineno-6-17)    console.log('New measurement:', event);
[](#%5F%5Fcodelineno-6-18)  });
[](#%5F%5Fcodelineno-6-19)  await Barometer.startMeasurementUpdates();
[](#%5F%5Fcodelineno-6-20)};
[](#%5F%5Fcodelineno-6-21)
[](#%5F%5Fcodelineno-6-22)const stopMeasurementUpdates = async () => {
[](#%5F%5Fcodelineno-6-23)  await Barometer.stopMeasurementUpdates();
[](#%5F%5Fcodelineno-6-24)  Barometer.removeAllListeners();
[](#%5F%5Fcodelineno-6-25)};
[](#%5F%5Fcodelineno-6-26)
[](#%5F%5Fcodelineno-6-27)const checkPermissions = async () => {
[](#%5F%5Fcodelineno-6-28)  const status = await Barometer.checkPermissions();
[](#%5F%5Fcodelineno-6-29)  console.log('Barometer permission status:', status.barometer);
[](#%5F%5Fcodelineno-6-30)};
[](#%5F%5Fcodelineno-6-31)
[](#%5F%5Fcodelineno-6-32)const requestPermissions = async () => {
[](#%5F%5Fcodelineno-6-33)  const status = await Barometer.requestPermissions();
[](#%5F%5Fcodelineno-6-34)  console.log('Barometer permission status after request:', status.barometer);
[](#%5F%5Fcodelineno-6-35)};
`

## API[¶](#api "Permanent link")

* [getMeasurement()](#getmeasurement)
* [isAvailable()](#isavailable)
* [startMeasurementUpdates()](#startmeasurementupdates)
* [stopMeasurementUpdates()](#stopmeasurementupdates)
* [checkPermissions()](#checkpermissions)
* [requestPermissions()](#requestpermissions)
* [addListener('measurement', ...)](#addlistenermeasurement-)
* [removeAllListeners()](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

### getMeasurement()[¶](#getmeasurement "Permanent link")

`[](#%5F%5Fcodelineno-7-1)getMeasurement() => Promise<GetMeasurementResult>
`

Get the latest measurement.

This method returns the most recent measurement from the barometer sensor.

Only available on Android and iOS.

**Returns:** `Promise<[Measurement](#measurement)>`

**Since:** 7.0.0

---

### isAvailable()[¶](#isavailable "Permanent link")

`[](#%5F%5Fcodelineno-8-1)isAvailable() => Promise<IsAvailableResult>
`

Check if the barometer sensor is available on the device.

**Returns:** `Promise<[IsAvailableResult](#isavailableresult)>`

**Since:** 7.0.0

---

### startMeasurementUpdates()[¶](#startmeasurementupdates "Permanent link")

`[](#%5F%5Fcodelineno-9-1)startMeasurementUpdates() => Promise<void>
`

Starts emitting `measurement` events.

Only available on Android and iOS.

**Since:** 7.0.0

---

### stopMeasurementUpdates()[¶](#stopmeasurementupdates "Permanent link")

`[](#%5F%5Fcodelineno-10-1)stopMeasurementUpdates() => Promise<void>
`

Stops emitting `measurement` events.

Only available on Android and iOS.

**Since:** 7.0.0

---

### checkPermissions()[¶](#checkpermissions "Permanent link")

`[](#%5F%5Fcodelineno-11-1)checkPermissions() => Promise<PermissionStatus>
`

Check if the app has permission to access the barometer sensor.

Only available on Android and iOS.

**Returns:** `Promise<[PermissionStatus](#permissionstatus)>`

**Since:** 7.0.0

---

### requestPermissions()[¶](#requestpermissions "Permanent link")

`[](#%5F%5Fcodelineno-12-1)requestPermissions() => Promise<PermissionStatus>
`

Request permission to access the barometer sensor.

Only available on Android and iOS.

**Returns:** `Promise<[PermissionStatus](#permissionstatus)>`

**Since:** 7.0.0

---

### addListener('measurement', ...)[¶](#addlistenermeasurement "Permanent link")

`[](#%5F%5Fcodelineno-13-1)addListener(eventName: 'measurement', listenerFunc: (event: MeasurementEvent) => void) => Promise<PluginListenerHandle>
`

Only available on Android and iOS.

| Param            | Type                                         |
| ---------------- | -------------------------------------------- |
| **eventName**    | 'measurement'                                |
| **listenerFunc** | (event: [Measurement](#measurement)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 7.0.0

---

### removeAllListeners()[¶](#removealllisteners "Permanent link")

`[](#%5F%5Fcodelineno-14-1)removeAllListeners() => Promise<void>
`

Remove all listeners for this plugin.

**Since:** 7.0.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### Measurement[¶](#measurement "Permanent link")

| Prop                 | Type   | Description                                                       | Since |
| -------------------- | ------ | ----------------------------------------------------------------- | ----- |
| **pressure**         | number | The pressure in hPa (hectopascal).                                | 7.0.0 |
| **relativeAltitude** | number | The relative altitude in meters. Only available on iOS.           | 7.0.0 |
| **timestamp**        | number | The timestamp of the measurement in milliseconds since the epoch. | 7.0.0 |

#### IsAvailableResult[¶](#isavailableresult "Permanent link")

| Prop            | Type    | Description                                                        | Since |
| --------------- | ------- | ------------------------------------------------------------------ | ----- |
| **isAvailable** | boolean | Indicates whether the barometer sensor is available on the device. | 7.0.0 |

#### PermissionStatus[¶](#permissionstatus "Permanent link")

| Prop          | Type                                                  | Description                         | Since |
| ------------- | ----------------------------------------------------- | ----------------------------------- | ----- |
| **barometer** | [BarometerPermissionState](#barometerpermissionstate) | The permission status of barometer. | 7.0.0 |

#### PluginListenerHandle[¶](#pluginlistenerhandle "Permanent link")

| Prop       | Type                |
| ---------- | ------------------- |
| **remove** | () => Promise<void> |

### Type Aliases[¶](#type-aliases "Permanent link")

#### GetMeasurementResult[¶](#getmeasurementresult "Permanent link")

`[Measurement](#measurement)`

#### BarometerPermissionState[¶](#barometerpermissionstate "Permanent link")

`[PermissionState](#permissionstate) | 'limited'`

#### PermissionState[¶](#permissionstate "Permanent link")

`'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'`

#### MeasurementEvent[¶](#measurementevent "Permanent link")

`[Measurement](#measurement)`

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/barometer/CHANGELOG.md).

## Breaking Changes[¶](#breaking-changes "Permanent link")

See [BREAKING.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/barometer/BREAKING.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/barometer/LICENSE).

May 17, 2026 

 Back to top 