question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DocumentPicker.show() callback is no executing

See original GitHub issue

Hi all, use this library in my project and the picker works as well, but the callback do nothings… This is my code:

DocumentPicker.show({
  filetype: [DocumentPickerUtil.pdf()],
}, (error, res) => {
  console.log('Fired!');
  if (error) return console.log(error);
  return console.log(res);
});

The document picker works, I choose a file and apparently works but the console don’t shows nothing.

I’m using React-Native 0.49.1, Android 5.1, Android Studio 3

Pd: I get this line in console: 11-27 14:06:48.306 13977-13977/com.android.documentsui D/Documents: onFinished() [content://com.android.externalstorage.documents/document/3CDD-ACC7%3AWhatsApp%2FMedia%2FWhatsApp%20Documents%2FTutorialPython2.pdf]'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
lewyuburicommented, Nov 28, 2017

Hi, I solve this just adding

public void onActivityResult(int requestCode, int resultCode, Intent data) {
  mReactInstanceManager.onActivityResult(this, requestCode, resultCode, data);
}

to my main java react native activity an works!

0reactions
herycommented, Mar 23, 2018

Why isn’t this documented? As an iOS developer implementing some native Android features in an hybrid RN app with very little Android experience, I feel like this could be useful there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DocumentPicker.show() callback is no executing · Issue #85 ...
The document picker works, I choose a file and apparently works but the console don't shows nothing. I'm using React-Native 0.49.1, Android 5.1, ......
Read more >
UIDocumentPickerViewController - does not pick document
I have the following document picker, adapted from here, running on iOS device / simulator. ... The function documentPicker is never called. Any ......
Read more >
react-native-document-picker/README.md - UNPKG
Run `npm install react-native-document-picker --save` ... _This is normally the filename of the file, but Android does not ... errorCallback(errorUp);.
Read more >
Picking files in React Native apps using ... - LogRocket Blog
Learn how to pick documents and files of any format from a user's device in a React Native application for iOS and Android....
Read more >
react-native-document-picker - npm
A react native interface to access documents from dropbox, google drive, iCloud.... Latest version: 8.1.3, last published: 3 days ago.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found