react-native-documents/document-picker

No documents listed on iOS

Closed this issue · 6 comments

I am using [react-native-document-picker] in react-native app.
The picking page is displayed but with no images on both simulator and real device, but I already have photos on my phone.
Help please

try {
const response = await DocumentPicker.pickSingle({
//type: DocumentPicker.types.images,
type: [DocumentPicker.types.allFiles],
});
if (debug) console.log(mod, caller+" =>", response);
} catch (err) {
console.log(mod, caller, err);
if (DocumentPicker.isCancel(err)) {
console.log(mod, caller+" => Cancel !!");
setImage(undefined);
return;
}
}
setImage(response);

info Fetching system and libraries information...
System:
OS: macOS 13.4.1
CPU: (10) arm64 Apple M2 Pro
Memory: 3.39 GB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.16.1
path: /usr/local/bin/node
Yarn:
version: 1.22.19
path: /usr/local/bin/yarn
npm:
version: 9.5.1
path: /usr/local/bin/npm
Watchman:
version: 2023.07.10.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.12.1
path: /Users/saadalla/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.4
- iOS 16.4
- macOS 13.3
- tvOS 16.4
- watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode:
version: 14.3.1/14E300c
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.19
path: /usr/bin/javac
Ruby:
version: 2.7.5
path: /Users/saadalla/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.3
wanted: 0.72.3
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Same. Nothing listed here.

Same here on iOS (android working perfectly fine). Is it a permission problem ?

EDIT: my bad, I didn't knew that what is in Photos app is not considered in Files. You have to transfer them manually (by clicking Share > Save to Files)

In my case, i'm trying to select an image to upload, so I just moved to this:
https://github.com/react-native-image-picker/react-native-image-picker

works like a charm.

Hello and thanks for asking,
closing as resolved.

document picker on ios is like the Files app. For images, there are other options like https://github.com/react-native-image-picker/react-native-image-picker

Thank you 🙂