Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expo-media-library

Package Overview
Dependencies
Maintainers
32
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-media-library

Provides access to user's media library.

  • 17.0.0-canary-20240904-69100c1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28K
decreased by-59.67%
Maintainers
32
Weekly downloads
 
Created
Source

expo-media-library

Provides access to user's media library.

API documentation

Installation in managed Expo projects

For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npx expo install expo-media-library

Configure for Android

This package automatically adds the READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permissions. They are used when accessing the user's images or videos.

<!-- Added permissions -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

If you'd like to access asset location (latitude and longitude EXIF tags), you have to add ACCESS_MEDIA_LOCATION permission to the AndroidManifest.xml:

<!-- Add this to AndroidManifest.xml -->
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />

Starting with Android 10, the concept of scoped storage is introduced. Currently, to make expo-media-library working with that change, you have to add android:requestLegacyExternalStorage="true" to AndroidManifest.xml:

<manifest ... >
  <application android:requestLegacyExternalStorage="true" ... >
    ...
  </application>
</manifest>

Configure for iOS

Add NSPhotoLibraryUsageDescription, and NSPhotoLibraryAddUsageDescription keys to your Info.plist:

<key>NSPhotoLibraryUsageDescription</key>
<string>Give $(PRODUCT_NAME) permission to access your photos</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Give $(PRODUCT_NAME) permission to save photos</string>

Run npx pod-install after installing the npm package.

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.

Keywords

FAQs

Package last updated on 04 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc