Open my-name-is-nheo opened 2 years ago
It would be nice to have an option to programmatically dismiss the Quicklook overlay. If the API needs to be backwards compatible, then one way to do it would be to enable using AbortController
API and to provide a signal
option to the .open()
function in a similar fashion that Fetch API works in JS.
Hello every one i have done this functionality on iOS, you can close the fileViewer any time you want by using following steps.
Add this method in file node_modules->react-native-file-viewer->ios->RNFileViewerManager.m
RCT_EXPORT_METHOD(close) { dispatch_async(dispatch_get_main_queue(), ^{ [[RNFileViewer topViewController] dismissViewControllerAnimated:true completion:nil]; }); }
now add this method in node_modules->react-native-file-viewer->index.js
function close() { if (Platform.OS == "ios") { return RNFileViewer.close(); } }
after adding method now navigate to the bottom of index.js, change the export lines from
export default { open }; export { open };
to->
this export default { open, close }; export { open, close };
now navigate to node_modules->react-native-file-viewer->index.d.ts
and add the following: declare function close()
and in this file change this line declare namespace _default { export { open }; }
like this declare namespace _default { export { open, close }; }
now you can use this function like this FileViewer.close()
Thanks... My issue is resolved now @Muzamil544
Is there a way we can trigger the close button on iOS when doing a swipe? Seems like android is behaving as expected, but not so on IOS