ammarahm-ed / react-native-scoped-storage

MIT License
58 stars 10 forks source link

"ACTIVITY_NOT_FOUND" on android 11 #4

Closed Yurrili closed 3 years ago

Yurrili commented 3 years ago

It seems that now you are only considering cases where the user is asking for Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION. Did I assumed it correctly?

This part of the code is holding the scenario of opening the file manager. if (intent.resolveActivity(reactContext.getPackageManager()) == null) { promise.reject("ACTIVITY_NOT_FOUND", "No activity fount to handle scoped storage access"); return; }

In my opinion this should be excluded to another function, where user is asked for permission. Or this is connected to something different?

When I removed this part, everything is working correctly. I'm testing in on phone with Android 11.

ammarahm-ed commented 3 years ago

It seems that now you are only considering cases where the user is asking for Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION. Did I assumed it correctly?

This part of the code is holding the scenario of opening the file manager. if (intent.resolveActivity(reactContext.getPackageManager()) == null) { promise.reject("ACTIVITY_NOT_FOUND", "No activity fount to handle scoped storage access"); return; }

In my opinion this should be excluded to another function, where user is asked for permission. Or this is connected to something different?

When I removed this part, everything is working correctly. I'm testing in on phone with Android 11.

No that's not the case. We are checking if any activity to open the intent is present on user's device or not. It works correctly on my real device on Android 11. Can you try testing on a different device otherwise we can just remove this check I think because there must always be a system app to handle scoped storage I assume...

Yurrili commented 3 years ago

So, I also have tested on another real device with Android 11, and the situation is the same. "ACTIVITY_NOT_FOUND"

I've tested on : Samsung A72 (Android 11), Xiaomi Poco x3 NFC (Android 11)

ammarahm-ed commented 3 years ago

So, I also have tested on another real device with Android 11, and the situation is the same. "ACTIVITY_NOT_FOUND"

I've tested on : Samsung A72 (Android 11), Xiaomi Poco x3 NFC (Android 11)

Which method in the library are you calling?

Yurrili commented 3 years ago

So, I also have tested on another real device with Android 11, and the situation is the same. "ACTIVITY_NOT_FOUND" I've tested on : Samsung A72 (Android 11), Xiaomi Poco x3 NFC (Android 11)

Which method in the library are you calling?

openDocument

ammarahm-ed commented 3 years ago

Fixed