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

rn-media-permissions

v0.1.1

Published

light library for media related permissions

Downloads

10

Readme

🎯 rn-media-permissions

Lightweight, zero-configuration React Native TurboModule for handling media-related permissions.

rn-media-permissions provides a unified, Promise-based API for requesting and checking camera, microphone, and photo-library permissions - without any manual native configuration.


🚀 Features

  • 🧩 TurboModule implementation - built for the New Architecture
  • Zero native setup - works out of the box
  • 📸 Supports Camera, Microphone, and Photo Library permissions
  • 🧠 Simple, type-safe, Promise-based API
  • 🛠 Includes utility methods for checking multiple permissions
  • ⚙️ Provides openAppSettings() helper to jump to system settings

📦 Installation

yarn add rn-media-permissions
# or
npm install rn-media-permissions

Requires React Native 0.71+ with the New Architecture (TurboModules) enabled.


🧠 Usage

import * as RnMediaPermissions from 'rn-media-permissions';

async function requestPermissions() {
  const camera = await RnMediaPermissions.requestCameraPermission();
  const mic = await RnMediaPermissions.requestMicrophonePermission();

  console.log('Camera:', camera);
  console.log('Microphone:', mic);
}

📘 API Reference

PermissionStatus

type PermissionStatus =
  | 'granted'
  | 'denied'
  | 'restricted'
  | 'not_determined'
  | 'limited'
  | 'unknown';

Methods

| Method | Description | Returns | |--------|--------------|----------| | requestCameraPermission() | Ask for camera access | Promise<PermissionStatus> | | getCameraPermissionStatus() | Check current camera permission | Promise<PermissionStatus> | | requestPhotoLibraryPermission() | Ask for photo-library access | Promise<PermissionStatus> | | getPhotoLibraryPermissionStatus() | Check current photo-library permission | Promise<PermissionStatus> | | requestMicrophonePermission() | Ask for microphone access | Promise<PermissionStatus> | | getMicrophonePermissionStatus() | Check current microphone permission | Promise<PermissionStatus> | | openAppSettings() | Open device app-settings page | Promise<boolean> | | checkMultiplePermissions() | Return statuses for all supported permissions | Promise<Record<string, PermissionStatus>> |


🧩 Example

import * as RnMediaPermissions from 'rn-media-permissions';

async function checkAll() {
  const results = await RnMediaPermissions.checkMultiplePermissions();
  console.log(results);
}

Example output:

{
  "camera": "granted",
  "microphone": "denied",
  "photoLibrary": "not_determined"
}

🧱 iOS Setup

Add the following to your app's ios/<AppName>/Info.plist if not already present:

<key>NSCameraUsageDescription</key>
<string>This app needs camera access to capture photos and videos</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for audio recording</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs photo library access to save and select media</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>We need photo library access to save photos</string>

🧱 Supported Platforms

| Platform | Supported | Notes | |-----------|------------|-------| | iOS | ✅ | Uses native AVCaptureDevice and PHPhotoLibrary | | Android | ✅ | Uses Manifest.permission.* APIs | | Web | ❌ | Not supported |


⚙️ Native Setup

None required. This library registers itself automatically as a TurboModule during initialization - no changes to Info.plist or AndroidManifest.xml are needed (except for the privacy usage keys listed above).


🧪 Example Project

A runnable example app is included in the repository at example/:

cd example
yarn install
yarn android
# or
yarn ios

💡 Motivation

Existing libraries like react-native-permissions require manual native configuration and platform-specific setup. rn-media-permissions was created to simplify the most common media-permission workflows and work natively with the React Native New Architecture.


📄 License

MIT © Jafar Jabr