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
[iOS] ios.openDocument(path) does nothing if current screen is a modal #311
Hi,
My app was using react-navigation's stack navigator which displays JS modals but I recently switched to native-stack navigator which displays a native modal.
In this modal I have a button allowing the user to download a file through this lib, Android generates a notification to open the downloaded file but not on iOS, so my app opens the downloaded document on iOS.
Everything works as intended but since I switched to a native-stack navigator ios.openDocument(path) just doesn't do anything, there is no exception thrown and the promise correctly returns void but nothing happens in the app.
I guess it has something to do with ViewController since I found this PR fixing the same kind of problem on another lib: https://github.com/vinzscam/react-native-file-viewer/pull/5/files - I'll try to apply it on this lib but since I've never been an Obj-C beast I'm not sure I'll succeed... :)
Hi @jitenshah19 nope I couldn't find a solution using this package, I ended up sharing the path (through RN Share API: https://reactnative.dev/docs/share) in the "url" prop instead of trying to open it.
Fixed in 1.1.1 and 0.25.3 (npm install react-native-blob-util@support-0.25): the iOS document menus and the preview are presented from the view controller on top, so they appear over a native modal. In 1.1.1 that covers open.file, open.chooser and open.optionsMenu; in 0.25.3 it covers ios.presentOptionsMenu, ios.presentOpenInMenu and ios.presentPreview. The older ios.openDocument and ios.previewDocument use the same code in both versions.
Activity
jitenshah19 commentedon Nov 20, 2023
Hi @psegalen. Were you able to find a solution to opening a file in ios using openDocument inside a modal?
psegalen commentedon Nov 20, 2023
Hi @jitenshah19 nope I couldn't find a solution using this package, I ended up sharing the path (through RN Share API: https://reactnative.dev/docs/share) in the "url" prop instead of trying to open it.
jitenshah19 commentedon Nov 21, 2023
I ended up using
react-native-file-viewerpackage.dgrover-spotnana commentedon Jun 30, 2024
@RonRadtke Do you have any update on this ? The issue still exists for both
ios.openDocument(path)andios.previewDocument(path)saoudnazir commentedon Jun 1, 2025
Same Issue
PrimulaX commentedon Jun 23, 2025
I have same problem, preview sheet is behind react navigation modal
fix(ios): present the document menus from the controller on top (back…
RonRadtke commentedon Nov 9, 2026
Fixed in 1.1.1 and 0.25.3 (
npm install react-native-blob-util@support-0.25): the iOS document menus and the preview are presented from the view controller on top, so they appear over a native modal. In 1.1.1 that coversopen.file,open.chooserandopen.optionsMenu; in 0.25.3 it coversios.presentOptionsMenu,ios.presentOpenInMenuandios.presentPreview. The olderios.openDocumentandios.previewDocumentuse the same code in both versions.