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

type: types.pdf does not limit the selection #706

Open
LJW123 opened this issue Mar 13, 2024 · 5 comments
Open

type: types.pdf does not limit the selection #706

LJW123 opened this issue Mar 13, 2024 · 5 comments
Labels
addressed in premium version This issue has been addressed (implemented, fixed) in the package available to sponsors.

Comments

@LJW123
Copy link

LJW123 commented Mar 13, 2024

Although I set it to PDF, I can still select files of any format. However, if I set it to images, only photos can be selected.

DocumentPicker.pick({
allowMultiSelection: false,
presentationStyle: 'fullScreen',
type: types.pdf,
copyTo: 'documentDirectory',
})

@LJW123
Copy link
Author

LJW123 commented Mar 13, 2024

android 13

@vonovak
Copy link
Collaborator

vonovak commented Mar 13, 2024

Hello and thanks for reporting,
can you share a video? What document provider did you use to select documents?

Thank you 🙂

@LJW123
Copy link
Author

LJW123 commented Mar 15, 2024

Thank you, I understand now;

it's a problem with the document provider.
When I use a Xiaomi phone (Android 13) and choose files using the system's file manager, I can only select PDFs. However, when I use a document provider from another app (like QQ, a popular instant messaging app in China), I can select files of any type.
When using a Huawei phone (HarmonyOS 2.0.1, and I cannot see the supported Android version), all document providers (including the system's own) allow me to select files of any format.

Screenrecorder-2024-03-15-09-36-59-350.mp4

@LJW123
Copy link
Author

LJW123 commented Mar 15, 2024

Is there no solution to this issue? Since third-party document providers do not restrict file types, there's nothing we can do. If it's unsolvable, can I limit which document providers can be used? For example, can I restrict users to only select files from the system's document provider and not from third-party document providers?

@vonovak
Copy link
Collaborator

vonovak commented Mar 23, 2024

Hello,
I'm sorry you have this issue but I don't think there's a way to fix it. The only thing you can do is handle this situation inside of your application and display an error in this case.
You can use the hasRequestedType field in the response (only available in the module for sponsors), see docs

@vonovak vonovak changed the title type: types.pdf not work ,version:9.1.1 type: types.pdf does not limit the selection May 27, 2024
@vonovak vonovak added the addressed in premium version This issue has been addressed (implemented, fixed) in the package available to sponsors. label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in premium version This issue has been addressed (implemented, fixed) in the package available to sponsors.
Projects
None yet
Development

No branches or pull requests

2 participants