You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DocumentPicker.show() is not working with "react-native": "0.59.1" #228
Library has been updated and now DocumentPicker.show() has been changed and also updated the support to pick multiple Document as well. Now to pick single document
try {
const res = await DocumentPicker.pick({
type: [DocumentPicker.types.allFiles],
});
this.setState({ singleFile: res });
} catch (err) {
if (DocumentPicker.isCancel(err)) {
//If user canceled the document selection
} else {
//For Unknown Error
throw err;
}
}
To pick multiple document
try {
const results = await DocumentPicker.pickMultiple({
type: [DocumentPicker.types.images],
});
for (const res of results) {
console.log('res : ' + JSON.stringify(res));
}
this.setState({ multipleFile: results });
} catch (err) {
if (DocumentPicker.isCancel(err)) {
//If user canceled the document selection
} else {
//For Unknown Error
throw err;
}
}
If you are still confused then you can see Example of File Picker in React Native. You will find how to integrated the Document picker for React Native 0.60 and the updated post.
On Fri, Aug 23, 2019 at 11:53 PM SnehalAgrawal ***@***.***> wrote:
Library has been updated and now DocumentPicker.show() has been changed
and also updated the support to pick multiple Document as well.
*Now to pick single document*
try {
const res = await DocumentPicker.pick({
type: [DocumentPicker.types.allFiles],
});
this.setState({ singleFile: res });
} catch (err) {
if (DocumentPicker.isCancel(err)) {
//If user canceled the document selection
} else {
//For Unknown Error
throw err;
}
}
*To pick multiple document*
try {
const results = await DocumentPicker.pickMultiple({
type: [DocumentPicker.types.images],
});
for (const res of results) {
console.log('res : ' + JSON.stringify(res));
}
this.setState({ multipleFile: results });
} catch (err) {
if (DocumentPicker.isCancel(err)) {
//If user canceled the document selection
} else {
//For Unknown Error
throw err;
}
}
If you are still confused then you can see Example of File Picker in
React Native <https://aboutreact.com/file-picker-in-react-native/>. You
will find how to integrated the Document picker for React Native 0.60 and
the updated post.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#228>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEB6QMB3SDKGBZCGK2YSF53QGAW3LANCNFSM4IMOSGCA>
.
On Tue, Aug 27, 2019 at 5:20 PM imran saeed ***@***.***> wrote:
Hi,
Thanks for your email. But after implementing . i am receiving error every
time i call pick function. any help please.
Regards,
Imran Saeed
On Fri, Aug 23, 2019 at 11:53 PM SnehalAgrawal ***@***.***>
wrote:
> Library has been updated and now DocumentPicker.show() has been changed
> and also updated the support to pick multiple Document as well.
> *Now to pick single document*
>
> try {
> const res = await DocumentPicker.pick({
> type: [DocumentPicker.types.allFiles],
> });
> this.setState({ singleFile: res });
> } catch (err) {
> if (DocumentPicker.isCancel(err)) {
> //If user canceled the document selection
> } else {
> //For Unknown Error
> throw err;
> }
> }
>
> *To pick multiple document*
>
> try {
> const results = await DocumentPicker.pickMultiple({
> type: [DocumentPicker.types.images],
> });
> for (const res of results) {
> console.log('res : ' + JSON.stringify(res));
> }
> this.setState({ multipleFile: results });
> } catch (err) {
> if (DocumentPicker.isCancel(err)) {
> //If user canceled the document selection
> } else {
> //For Unknown Error
> throw err;
> }
> }
>
> If you are still confused then you can see Example of File Picker in
> React Native <https://aboutreact.com/file-picker-in-react-native/>. You
> will find how to integrated the Document picker for React Native 0.60 and
> the updated post.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#228>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AEB6QMB3SDKGBZCGK2YSF53QGAW3LANCNFSM4IMOSGCA>
> .
>
Possible Undefined promise objection. TypeError undefined is an object
(evaluating _reactnativedocumentpicker DocumentPicker.Iscancel )
Any help please.
On Tue, Aug 27, 2019 at 5:29 PM imran saeed ***@***.***> wrote:
This is exact message i am getting.
"line":"166950", "coloumn":"92", "sourceURL":"
http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false"}
On Tue, Aug 27, 2019 at 5:20 PM imran saeed ***@***.***> wrote:
> Hi,
> Thanks for your email. But after implementing . i am receiving error
> every time i call pick function. any help please.
>
> Regards,
>
> Imran Saeed
>
> On Fri, Aug 23, 2019 at 11:53 PM SnehalAgrawal ***@***.***>
> wrote:
>
>> Library has been updated and now DocumentPicker.show() has been changed
>> and also updated the support to pick multiple Document as well.
>> *Now to pick single document*
>>
>> try {
>> const res = await DocumentPicker.pick({
>> type: [DocumentPicker.types.allFiles],
>> });
>> this.setState({ singleFile: res });
>> } catch (err) {
>> if (DocumentPicker.isCancel(err)) {
>> //If user canceled the document selection
>> } else {
>> //For Unknown Error
>> throw err;
>> }
>> }
>>
>> *To pick multiple document*
>>
>> try {
>> const results = await DocumentPicker.pickMultiple({
>> type: [DocumentPicker.types.images],
>> });
>> for (const res of results) {
>> console.log('res : ' + JSON.stringify(res));
>> }
>> this.setState({ multipleFile: results });
>> } catch (err) {
>> if (DocumentPicker.isCancel(err)) {
>> //If user canceled the document selection
>> } else {
>> //For Unknown Error
>> throw err;
>> }
>> }
>>
>> If you are still confused then you can see Example of File Picker in
>> React Native <https://aboutreact.com/file-picker-in-react-native/>. You
>> will find how to integrated the Document picker for React Native 0.60 and
>> the updated post.
>>
>> —
>> You are receiving this because you commented.
>> Reply to this email directly, view it on GitHub
>> <#228>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AEB6QMB3SDKGBZCGK2YSF53QGAW3LANCNFSM4IMOSGCA>
>> .
>>
>
@grwimran Please update your import to import DocumentPicker from 'react-native-document-picker';, that error suggests you are importing import {DocumentPicker} from 'react-native-document-picker'; which is undefined.
@grwimran This is because you haven't linked the library or have import issue that is why it is unable to find DocumentPicker. Please link the library or check the import and try again.
Here is a step by step example please go through it https://aboutreact.com/file-picker-in-react-native/
Thanks for your reply. I am working on android and react-native 0.60.4 . i
ran command
react-native link react-native-document-picker
info Android module "react-native-document-picker" is already linked.
Please help.
Regards,
Imran Saeed
Activity
SnehalAgrawal commentedon Aug 17, 2019
@Pratyanch-7415 react-native-document-picker version?
grwimran commentedon Aug 23, 2019
Same Problem with RN 0.60 and react-native-document-picker 3.2.4 .
Any Help Please
SnehalAgrawal commentedon Aug 23, 2019
Library has been updated and now DocumentPicker.show() has been changed and also updated the support to pick multiple Document as well.
Now to pick single document
To pick multiple document
If you are still confused then you can see Example of File Picker in React Native. You will find how to integrated the Document picker for React Native 0.60 and the updated post.
grwimran commentedon Aug 27, 2019
grwimran commentedon Aug 27, 2019
grwimran commentedon Aug 27, 2019
dantman commentedon Aug 27, 2019
@grwimran Please update your import to
import DocumentPicker from 'react-native-document-picker';, that error suggests you are importingimport {DocumentPicker} from 'react-native-document-picker';which is undefined.SnehalAgrawal commentedon Aug 27, 2019
@grwimran This is because you haven't linked the library or have import issue that is why it is unable to find DocumentPicker. Please link the library or check the import and try again.
Here is a step by step example please go through it https://aboutreact.com/file-picker-in-react-native/
grwimran commentedon Aug 27, 2019
SnehalAgrawal commentedon Aug 27, 2019
Can you please check for this
#228 (comment)
grwimran commentedon Aug 27, 2019
Thanx Done
MaximilianoRG commentedon Sep 9, 2019
Try this:
Don't put lib(Project)DocumentPicker.a on Build Phases.
Change the order of Link binary with Libraries and Copy Boundle Resources in this order:
When i did this. It worked.