npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

expo-detect-carplay

v1.1.0

Published

Expo module for observing CarPlay and Android Auto connection state

Readme

expo-detect-carplay

Expo native module for observing CarPlay and Android Auto connection state on iOS and Android, including persistent monitoring, notifications, event logging, native API forwarding, and optional background-geolocation integration.

| Platform | Detection | Background behavior | | -------- | -------------------------------------------- | --------------------------------------------------- | | Android | AndroidX CarConnection | Connected-device foreground service | | iOS | Car audio route; optional Driving Task scene | Foreground observation with optional location wakes | | Web | Inert fallback | Monitoring methods are no-ops |

Important constraints

  • Native code is required. Expo Go is not supported.
  • Add the bundled config plugin before creating a development build.
  • Basic iOS detection does not require a CarPlay entitlement, but audio-route observation cannot launch a terminated app.
  • Enable ios.carplayDrivingTask only after Apple grants the entitlement and the provisioning profile contains it.
  • The background-geolocation bridge is optional and requires react-native-background-geolocation in the consuming app.

Install

npx expo install expo-detect-carplay

Add the config plugin:

{
  "expo": {
    "plugins": ["expo-detect-carplay"]
  }
}

Rebuild the native application after adding or changing the plugin:

npx expo prebuild
npx expo run:android
# or: npx expo run:ios

See Getting started for platform permissions and the complete installation path.

Monitor vehicle connections

import { Platform } from 'react-native';
import { ExpoDetectCarplay } from 'expo-detect-carplay';

if (Platform.OS === 'android') {
  const granted = await ExpoDetectCarplay.requestPermissionsAsync();
  if (!granted) {
    throw new Error('Vehicle connection permissions were not granted');
  }
}

const connected = ExpoDetectCarplay.addListener('onCarPlayConnected', (event) =>
  console.log('connected', event.transport)
);
const disconnected = ExpoDetectCarplay.addListener('onCarPlayDisconnected', (event) =>
  console.log('disconnected', event.reason)
);

await ExpoDetectCarplay.startCarPlayMonitoring();
const status = ExpoDetectCarplay.getCarPlayConnectionStatus();

// When persistent monitoring is no longer wanted:
await ExpoDetectCarplay.stopCarPlayMonitoring();
connected.remove();
disconnected.remove();

The default export remains available for backwards compatibility. See Monitoring for lifecycle, diagnostics, and cleanup. Basic iOS audio-route monitoring needs no permission; call requestPermissionsAsync on iOS only after configuring the location usage descriptions through ios.backgroundLocation.

React hook

import { useCarPlay } from 'expo-detect-carplay';

function VehicleStatus() {
  const { connected, transport, isMonitoring } = useCarPlay({
    autoStart: true,
  });

  return null; // Render these values in your application UI.
}

Typed config-plugin options

import type { CarPlayPluginProps } from 'expo-detect-carplay/plugin';

See Config plugin for Android Auto registration, iOS background location, the Driving Task entitlement, and integration options.

Documentation

Contributing

npm run test:all

For clean-prebuild, emulator/device, and physical-accessory coverage, follow the repository end-to-end test environment.

Repository-specific guidance is in AGENTS.md.

License

MIT