actionViewIntent fails on android 9+
See original GitHub issue- react@16.8.6
- react-native@0.59.8
- rn-fetch-blob@0.10.15
I am calling my api to get a pdf file:
const { dirs } = RNFetchBlob.fs;
const saveDirectory = Platform.select({ ios: dirs.DocumentDir, android: dirs.DownloadDir });
RNFetchBlob
.config({ path: `${saveDirectory}/${docName || "temp"}.pdf`})
.fetch(method, url, headers, body)
.then(resolve);
It successfully resolves. Then, I try to open it:
RNFB.android.actionViewIntent(pdf, "application/pdf");
After a little bit of waiting I get a YellowBox warning, with a code “EUNSPECIFIED”.
It’s happening on Honor 8x with android 9. Works on OnePlus One with android 6.0.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Developers - actionViewIntent fails on android 9+ - - Bountysource
actionViewIntent fails on android 9 + ... I am calling my api to get a pdf file: const { dirs } = RNFetchBlob.fs;...
Read more >RNFetchBlob.android.actionViewIntent does not working on ...
There is no error thrown. So I can't able to debug. Below is my code: RNFetchBlob.android.actionViewIntent(filePath, mimeType);.
Read more >Intent - Android Developers
... 9, 8, 7, 6, 5, 4, 3, 2, 1. Class Index · Package Index. android ... Error · ListFormatter.Type · ListFormatter.Width ·...
Read more >Crash due to file storage on Android 10 and above - Cpming
Crash due to file storage on Android 10 and above ... actionViewIntent(downloadPath ... Target Android 9 (API level 28) or lower.
Read more >App is not indexable by Google Search; consider adding ...
I am copying and pasting my current working android app project. ... Studio TutorialTags action-view intent filter error, android app error, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Solved it by manipulating with the native java code.
RNFetchBlob.java:
before:
after:
This is actually worth a separate PR.
Maybe for android 9+ an approach using ACTION_OPEN_DOCUMENT is needed instead of ACTION_VIEW as here: https://stackoverflow.com/questions/61356281/android-files-unable-to-get-file-path-from-content-uri-when-file-is-selected-f.