Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/flyerhq/react-native-android-uri-path

Get an absolute path to a file retrieved by Android's Intent.ACTION_GET_CONTENT that returns a content URI.
https://github.com/flyerhq/react-native-android-uri-path

absolute-path android intent kotlin react-native resolver

Last synced: about 2 months ago
JSON representation

Get an absolute path to a file retrieved by Android's Intent.ACTION_GET_CONTENT that returns a content URI.

Awesome Lists containing this project

README

        

# React Native Android URI Path

⚠️⚠️⚠️ https://github.com/rnmods/react-native-document-picker/issues/70#issuecomment-846883668 also mentioned in the README of the document picker repo as well, is the correct way to retrieve the path. This repo will be archived. ⚠️⚠️⚠️


[![npm](https://img.shields.io/npm/v/@flyerhq/react-native-android-uri-path)](https://www.npmjs.com/package/@flyerhq/react-native-android-uri-path)
[![build](https://github.com/flyerhq/react-native-android-uri-path/workflows/build/badge.svg)](https://github.com/flyerhq/react-native-android-uri-path/actions?query=workflow%3Abuild)
[![Maintainability](https://api.codeclimate.com/v1/badges/b439310da19b3d6b3917/maintainability)](https://codeclimate.com/github/flyerhq/react-native-android-uri-path/maintainability)

Get an absolute path to a file retrieved by Android's `Intent.ACTION_GET_CONTENT` that returns a `content://` URI.

## Getting Started

```bash
yarn add @flyerhq/react-native-android-uri-path
```

⚠️ Use version `2.1.3` for React Native below `0.65.0` and latest for `0.65.0` and above

## Usage

```ts
import getPath from '@flyerhq/react-native-android-uri-path'

const path = getPath(uriString)
```

Other platforms will return `uriString`, so no need to use `Platform`.

## License

[MIT](LICENSE)