---
title: Announcing the Capacitor Barometer Plugin
description: The new Capacitor Barometer plugin brings real-time atmospheric pressure monitoring to your Capacitor apps on Android and iOS.
date:
  created: 2025-07-26
  updated: 2026-07-10
authors:
  - robingenz
categories:
  - Announcements
  - Capacitor
  - SDKs
links:
  - Capacitor Barometer: sdks/capacitor/barometer.md
faq: true
---

# Capacitor Barometer Plugin: Air Pressure Sensor

We're pleased to introduce the [Capacitor Barometer plugin](../../sdks/capacitor/barometer.md), bringing atmospheric pressure sensing capabilities to your Capacitor applications. This plugin enables precise barometric measurements in hectopascals (hPa) with support for real-time updates and sensor availability detection across Android and iOS platforms. The plugin is now available for all Capawesome [Insiders](../../insiders/index.md).

<!-- more -->

Whether you're building weather applications, altitude tracking systems, or environmental monitoring tools, this plugin provides the foundation for atmospheric pressure data integration in your cross-platform apps.

## Installation

To install the Capacitor Barometer plugin, please refer to the [Installation](../../sdks/capacitor/barometer.md/#installation) section in the plugin documentation.

## Usage

The Capacitor Barometer plugin provides a comprehensive API for atmospheric pressure monitoring with both single measurements and continuous updates. Let's explore the core functionality that makes this plugin essential for environmental sensing applications.

### Checking sensor availability

Before requesting measurements, verify that the device has a barometer sensor using the [`isAvailable()`](../../sdks/capacitor/barometer.md#isavailable) method:

```typescript
import { Barometer } from '@capawesome-team/capacitor-barometer';

const checkBarometerSupport = async () => {
  const { isAvailable } = await Barometer.isAvailable();
  
  if (isAvailable) {
    console.log('Barometer sensor is available on this device');
    // Proceed with barometer operations
  } else {
    console.log('Barometer sensor is not available');
    // Handle gracefully or show alternative UI
  }
};
```

This check ensures your app gracefully handles devices without barometer sensors and provides appropriate user feedback.

### Managing permissions

Handle sensor permissions appropriately using the permission methods provided by the plugin:

```typescript
import { Barometer } from '@capawesome-team/capacitor-barometer';

const handleBarometerPermissions = async () => {
  // Check current permission status
  const permissions = await Barometer.checkPermissions();
  
  if (permissions.sensors !== 'granted') {
    // Request permission if not already granted
    const result = await Barometer.requestPermissions();
    
    if (result.sensors === 'granted') {
      console.log('Sensor permission granted');
      // Proceed with barometer operations
    } else {
      console.log('Sensor permission denied');
      // Handle permission denial
    }
  }
};
```

This ensures your app has the necessary permissions to access the barometer sensor, enhancing user trust and compliance with platform guidelines.

### Getting a single measurement

Use the [`getMeasurement()`](../../sdks/capacitor/barometer.md#getmeasurement) method to retrieve the current atmospheric pressure reading from the device's barometer sensor:

```typescript
import { Barometer } from '@capawesome-team/capacitor-barometer';

const getCurrentPressure = async () => {
  try {
    const { measurement } = await Barometer.getMeasurement();
    console.log('Current pressure:', measurement.pressure, 'hPa'); 
    
    // Optional: Calculate relative altitude if available
    if (measurement.relativeAltitude !== undefined) {
      console.log('Relative altitude:', measurement.relativeAltitude, 'm');
    }
  } catch (error) {
    console.error('Failed to get barometer measurement:', error);
  }
};
```

The measurement object contains the pressure value in hectopascals, providing you with accurate atmospheric pressure data for your application's needs.

### Real-time measurement updates

For applications requiring continuous atmospheric pressure monitoring, use the [`startMeasurementUpdates()`](../../sdks/capacitor/barometer.md#startmeasurementupdates) method to receive real-time pressure readings:

```typescript
import { Barometer } from '@capawesome-team/capacitor-barometer';

const startContinuousMonitoring = async () => {
  // Listen for measurement updates
  Barometer.addListener('measurementReceived', (event) => {
    console.log('New pressure reading:', event.measurement.pressure, 'hPa');
  });

  // Start receiving measurement updates
  await Barometer.startMeasurementUpdates();
};

const stopContinuousMonitoring = async () => {
  // Stop measurement updates to conserve battery
  await Barometer.stopMeasurementUpdates();
  
  // Remove all listeners
  Barometer.removeAllListeners();
};
```

Remember to call [`stopMeasurementUpdates()`](../../sdks/capacitor/barometer.md#stopmeasurementupdates) when continuous monitoring is no longer needed to preserve device battery life.

## FAQ

### Which platforms does the Capacitor Barometer plugin support?

The plugin provides atmospheric pressure sensing on Android and iOS.

### How do I know whether a device has a barometer sensor?

Call `isAvailable()` before requesting measurements. It returns whether the device has a barometer sensor, so you can fall back gracefully on devices that don't.

### Can I receive continuous pressure readings?

Yes. `startMeasurementUpdates()` emits a `measurementReceived` event for each new reading. Call `stopMeasurementUpdates()` when you no longer need updates to conserve battery.

### What unit are the measurements in?

Pressure is reported in hectopascals (hPa). When available, the measurement also includes `relativeAltitude` in meters.

## Related Posts

- [Exploring the Capacitor Barometer API](./exploring-the-capacitor-barometer-api.md)

## Conclusion

The [Capacitor Barometer plugin](../../sdks/capacitor/barometer.md) delivers atmospheric pressure sensing for weather apps, altitude tracking, and environmental monitoring, with a single cross-platform API for Android and iOS. Explore the complete [API Reference](../../sdks/capacitor/barometer.md#api) for every method and option.

**Missing a feature?** [Create a feature request](https://github.com/capawesome-team/capacitor-plugins/issues/new/choose){:target="_blank"} in our [GitHub repository](https://github.com/capawesome-team/capacitor-plugins){:target="_blank"}.

Join the Capawesome [Discord](https://discord.gg/VCXxSVjefW){:target="_blank"} server for questions and subscribe to the Capawesome [newsletter](https://capawesome.io/newsletter/){:target="_blank"} to stay updated.
