Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to access USB OTG disk on Android API 10 device? #989

Open
guofoo opened this issue Mar 5, 2021 · 3 comments
Open

How to access USB OTG disk on Android API 10 device? #989

guofoo opened this issue Mar 5, 2021 · 3 comments

Comments

@guofoo
Copy link

guofoo commented Mar 5, 2021

On an Android API 8.x phone, my React-Native app is able to read the /storage dir and see the inserted USB OTG drive under a path name such as /storage/1E04-2D05, and access all files.

But when I tried the same app on an Android API 9 and API 10 phones, an inserted USB OTG disk does not show up under /storage. And I can't seem to find it under other common directories either. I've searched under:

RNFS.DocumentDirectoryPath
RNFS.ExternalDirectoryPath
RNFS.ExternalStorageDirectoryPath

Does anyone know what the issue could be? Or what has changed to cause this? Or which path should I use? I've tried /storage/usbdisk and that doesn't work either.

@vovkasm
Copy link

vovkasm commented Mar 11, 2021

@guofoo You can't with this module in current state. Same for rn-fetch-blob. At the current state you can only write java/kotlin code yourself to implement required functional (you'll probably will need StorageManager API )

@guofoo
Copy link
Author

guofoo commented Mar 12, 2021

@vovkasm Thanks, is it due to changes between Android 9 -> Android 10? Because it works fine in Android 7,8.1, and 9.

@guofoo guofoo changed the title How to access USB OTG disk on Android 10 device? How to access USB OTG disk on Android 9 & 10 device? Mar 18, 2021
@guofoo guofoo changed the title How to access USB OTG disk on Android 9 & 10 device? How to access USB OTG disk on Android API 9 & API 10 device? Mar 18, 2021
@guofoo guofoo changed the title How to access USB OTG disk on Android API 9 & API 10 device? How to access USB OTG disk on Android API 10 device? Mar 19, 2021
@guofoo
Copy link
Author

guofoo commented May 7, 2021

Trying to tie together all the related issues to the root issue: #998
#998

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

No branches or pull requests

2 participants