Index of every page on this site: llms.txt
All skills
software-mansion-labs avatar

/react-native-client

@43cde80
Run it yourself

React Native / Expo SDK for Fishjam — video/audio streaming on iOS and Android. Use when writing a React Native or Expo app that calls Fishjam, configures the Fishjam Expo plugin, sets up permissions, runs background streaming, integrates CallKit, or renders RTCView. Trigger on: '@fishjam-cloud/react-native-client', 'fishjam expo plugin', 'FishjamProvider mobile', 'useCameraPermissions', 'useMicrophonePermissions', 'useForegroundService', 'useCallKit', 'useCallKitEvent', 'useCallKitService', 'RTCView', 'RTCPIPView', 'ScreenCapturePickerView', 'startPIP', 'stopPIP', 'AudioDeviceType', 'useAudioOutput', '@fishjam-cloud/react-native-webrtc', 'fishjam react native', 'expo fishjam', 'fishjam ios', 'fishjam android', 'broadcast extension'. Re-exports @fishjam-cloud/react-client hooks plus mobile-only: permissions, foreground service, iOS broadcast extension, audio routing, CallKit, Expo config plugin.

  • 11 files
  • 54.9 KB
  • MIT
  • Updated 6 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/software-mansion-labs/skills/react-native-client

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

permissions.md

≈958 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Permissions

iOS and Android both gate camera and microphone behind explicit user grants. The mobile SDK exposes two hooks that wrap the OS APIs.

Source: packages/mobile-client/src/hooks/usePermissions.ts in the web-client-sdk monorepo.

API

import {
  useCameraPermissions,
  useMicrophonePermissions,
  type PermissionStatus,
} from '@fishjam-cloud/react-native-client';

const [queryCamera, requestCamera] = useCameraPermissions();
const [queryMic, requestMic] = useMicrophonePermissions();

Both hooks return a tuple, not an object:

  • query: () => Promise<PermissionStatus> — non-prompting check
  • request: () => Promise<PermissionStatus> — triggers the native dialog
type PermissionStatus = 'granted' | 'denied' | 'prompt';

'prompt' means the user hasn't been asked yet (or, on Android, the system allows re-asking).

Pattern: request before init

import { useEffect } from 'react';
import {
  FishjamProvider,
  useCameraPermissions,
  useMicrophonePermissions,
  useInitializeDevices,
} from '@fishjam-cloud/react-native-client';

function PermissionGate() {
  const [queryCamera, requestCamera] = useCameraPermissions();
  const [queryMic, requestMic] = useMicrophonePermissions();
  const { initializeDevices } = useInitializeDevices();

  useEffect(() => {
    (async () => {
      let cam = await queryCamera();
      if (cam !== 'granted') cam = await requestCamera();

      let mic = await queryMic();
      if (mic !== 'granted') mic = await requestMic();

      if (cam === 'granted' && mic === 'granted') {
        await initializeDevices({ enableAudio: true, enableVideo: true });
      } else {
        // Show your "please grant access" UI
      }
    })();
  }, []);

  return null;
}

Always check the result of request — the user may deny, in which case useInitializeDevices will succeed with no devices and useCamera().cameraDeviceError reports the failure.

Denied state recovery

Once a user has denied, calling requestCamera() again may:

  • Android: show the dialog again with a "Don't ask again" option, until they tick it.
  • iOS: silently re-return the previous state — the user must change permission in Settings.

UX recommendation: on denied, show a screen explaining how to enable in OS Settings, with a deep-link button (Linking.openSettings()).

iOS Info.plist usage descriptions

iOS requires usage-description strings or the permission request silently fails. The Expo plugin adds defaults; override in app.json:

{
  "expo": {
    "ios": {
      "infoPlist": {
        "NSCameraUsageDescription": "MyApp uses the camera for video calls.",
        "NSMicrophoneUsageDescription": "MyApp uses the microphone for calls.",
        "NSPhotoLibraryUsageDescription": "MyApp accesses photos for sharing screenshots."
      }
    }
  }
}

These show in the OS permission dialog — be honest and specific. Apple rejects review submissions with generic strings like "We need this."

Foreground service permissions (Android)

If you want to keep media flowing while the app is backgrounded, you also need foreground service permissions and a foreground service notification. See foreground-service.md.

Screen capture permission

Screen capture has its own permission flow on both platforms:

  • Android — MediaProjection consent prompt fires on each capture attempt; no separate permission to request.
  • iOS — the user picks your app from the system's broadcast picker (ScreenCapturePickerView); see screen-sharing.md.

useCameraPermissions / useMicrophonePermissions do not cover screen capture.

Sources

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 43cde80. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 6 months ago

README badge

README badge for software-mansion-labs/skills/react-native-client