-
Notifications
You must be signed in to change notification settings - Fork 126
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
Unable to open PDF file on Android 11 - targetSdkVersion 30 #66
Comments
actionViewIntent is in general still working, also with pdf. Using it in production myself. You're using the old library? This one did not trigger a promise rejection if no app to open the pdf is installed. React-native-blob-util will reject the promise and thus give you some information. The reason I'm writing this is, that I had the same behavior you're describing on devices which didn't have a proper app to open the file type I wanted to open. So please check if you have any app installed that can open a pdf. (Not just open but react on actionviewintent, so basically opens if you click on a pdf in e.g. a file manager) |
Thanks for the quick response @RonRadtke. Yesterday I tested on an emulator, so the option of not having an app could be there, but today I've been able to test it on an Android 11 device which has PDF apps and where we're able to open the PDF if we access it from a file manager. The result is no feedback other than |
Issue solved! Adding:
on the |
Glad to hear. Then I close the issue here |
Hello,
I've been using this library (the former repo) for quite some time in order to open PDF files.
Recently, I've updated Android's
targetSdkVersion
to 30, and I've noticed theactionViewIntent
function is not functioning on Android 11.Using it as:
android.actionViewIntent(filePath, `application/pdf`);
No error or whatsoever is thrown, so not really possible to apport more specific information.
Currently, asking for these permissions on
AndroidManifest.xml
:And have both
preserveLegacyExternalStorage
&requestLegacyExternalStorage
set as true.Using latest
"react-native-blob-util": "0.13.15"
versionHas somebody else faced this issue after updating?
Am I missing some specific settings?
Thanks in advance.
EDIT:
Paths were I've tested to open the .pdf from (emulator):
/data/user/0/com.{app_bundle}/cache/{....}.pdf
/storage/emulated/0/Documents/{....}.pdf
The text was updated successfully, but these errors were encountered: