Skip to content

Conversation

@santhoshvai
Copy link
Member

💡 Overview

Added utility methods for detecting hardware presence SDK as below

import { StreamVideoRN } from "@stream-io/video-react-native-sdk";

const hasCameraHardware = await StreamVideoRN.androidHasCameraHardware();
const hasAudioOutputHardware =
  await StreamVideoRN.androidHasAudioOutputHardware();
const hasMicrophoneHardware = await StreamVideoRN.androidHasMicrophoneHardware();

🎫 Ticket: https://linear.app/stream/issue/RN-310

📑 Docs: https://github.com/GetStream/docs-content/pull/796

@santhoshvai santhoshvai changed the title feat: add native methods to check for hardware presence in android feat: add native methods to check for hardware presence in android RN-310 Nov 27, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds three native utility methods to detect hardware presence on Android devices: camera, microphone, and audio output. These methods check system features through the Android PackageManager API and return true for non-Android platforms.

  • Added TypeScript wrapper methods in StreamVideoRN class that handle platform checks
  • Implemented corresponding native Android methods using PackageManager.hasSystemFeature()
  • All methods return Promise and default to true on non-Android platforms

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
packages/react-native-sdk/src/utils/StreamVideoRN/index.ts Added three new static async methods (androidHasAudioOutputHardware, androidHasMicrophoneHardware, androidHasCameraHardware) with platform checks
packages/react-native-sdk/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt Implemented three @ReactMethod functions that use PackageManager to check for audio output, microphone, and camera hardware features

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@santhoshvai santhoshvai merged commit 90fddbc into main Nov 27, 2025
4 checks passed
@santhoshvai santhoshvai deleted the android-hardware-check branch November 27, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants