Skip to content

FCE-2803: Add permissions helpers#481

Merged
MiloszFilimowski merged 8 commits intomainfrom
mfilimowski/fce-2803-permission-helpers
Feb 26, 2026
Merged

FCE-2803: Add permissions helpers#481
MiloszFilimowski merged 8 commits intomainfrom
mfilimowski/fce-2803-permission-helpers

Conversation

@MiloszFilimowski
Copy link
Collaborator

@MiloszFilimowski MiloszFilimowski commented Feb 24, 2026

Description

Add useCameraPermissions and useMicrophonePermissions hooks to @fishjam-cloud/react-native-client for querying and requesting camera/microphone permissions. Patch getUserMedia to log warnings when called without granted permissions.

Update the example app (fishjam-chat) to request permissions before initializing devices and show an "Open Settings" fallback when permissions are denied.

Motivation and Context

There was no built-in way for consumers of the mobile SDK to check or request media permissions. Developers had to wire up platform-specific permission logic themselves. This also meant getUserMedia could silently fail when permissions were missing.

Documentation impact

  • Documentation update required
  • Documentation updated in another PR
  • [] No documentation update required

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)

@linear
Copy link

linear bot commented Feb 24, 2026

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

Adds permission-related helpers to the React Native mobile client, including runtime warnings around getUserMedia permission state and new exported hooks for querying/requesting camera/microphone access. Updates the example app to request permissions up front and route users to OS settings when denied.

Changes:

  • Patch navigator.mediaDevices.getUserMedia to log warnings when camera/mic permissions aren’t granted.
  • Add useCameraPermissions / useMicrophonePermissions hooks to the mobile-client public API.
  • Update the fishjam-chat example preview flow to request permissions and show an “Open Settings” fallback.

Reviewed changes

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

Show a summary per file
File Description
packages/mobile-client/src/webrtc-polyfill.ts Registers a new getUserMedia patch during globals setup.
packages/mobile-client/src/overrides/getUserMedia.ts Implements the permission-status warning wrapper around getUserMedia.
packages/mobile-client/src/index.ts Exports new permission hooks from the package entrypoint.
packages/mobile-client/src/hooks/usePermissions.ts Adds hooks for querying/requesting camera/microphone permissions.
examples/mobile-client/fishjam-chat/hooks/useMediaPermissions.ts New example hook to request media permissions and expose settings navigation.
examples/mobile-client/fishjam-chat/app/room/preview.tsx Integrates the new permissions flow into the preview screen UI/initialization.

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

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

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


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

@MiloszFilimowski MiloszFilimowski merged commit f3014ba into main Feb 26, 2026
2 checks passed
@MiloszFilimowski MiloszFilimowski deleted the mfilimowski/fce-2803-permission-helpers branch February 26, 2026 13:41
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