Closed wakeless closed 4 years ago
It would be nice to have this one merged. Thank you!
I need to fork this repo just for that reason but probably rather than enforce it for everyone it should be pass as a parameter instead?
+1 please someone merge this PR, it works!
FWIW this has been working in production for us for quite some time.
Any chance someone merges this ? (and all the other 39 PRs) or give permissions to other people so they can do the merges.
I solved this issue with a workaround.
Just add this in your package.json
postinstall:
"postinstall": "exec sed -i '' '122i\\\nintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);' node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlob.java"
I used this PR to make changes. I hope it helps you.
Thanks @AdeilsonSuperlogica it solved my issue!
Solved for me @AdeilsonSuperlogica
So basically this needs to be added to line 122-123 of file android/src/main/java/com/RNFetchBlob/RNFetchBlob.java
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if above step is not working to do the below step: overwrite the line 121 in android/src/main/java/com/RNFetchBlob/RNFetchBlob.java
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // line 121
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); // line 122
Just in case, you guys can also install the package directly from this branch.
yarn add git+https://github.com/Ferocia/rn-fetch-blob.git#android-9-open-file
Thanks, @wakeless!
@Traviskn do you think this PR will get merged anytime soon? Ive come across this issue when trying to open a PDF on Android using RNFetchBlob.android.actionViewIntent( targetPath, 'application/pdf' )
https://github.com/joltup/rn-fetch-blob/pull/317#issuecomment-496812470 This worked me well
Thank you for all the testing confirmation that this PR fixes the described issue, apologies for the delayed review
as already asked by @bova80 there are many who do not want or be able to update react-native to version 0.60 or higher... so is it possible to update to have a merge to solve this problem also in version 0.10.15? Thanks
Is this fix available in 0.10.15 ? Because i'm still facing it
+1, still facing this issue in 0.10.15
mark Add the FLAG_ACTIVITY_NEW_TASK flag.
This is caused by an error on Android 9: 'Error: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?'