joltup / rn-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.81k stars 773 forks source link

[IOS] Detect closing of the UIDocumentInteractionController #515

Open d-es-ign opened 4 years ago

d-es-ign commented 4 years ago

Currently there is no way of knowing on IOS when the user has closed the native UIDocumentInteractionController that handles previewing files like pdf's and images.

Found the following native function that should help with detecting this: https://developer.apple.com/documentation/uikit/uidocumentinteractioncontrollerdelegate/1616809-documentinteractioncontrollerdid

One example of a use case would be the ability to customise the status bar while the preview is opened. On Android this is already possible by setting up intents to detect this.

rickysullivan commented 3 years ago

I too had hopes of adding a callback function to my open/preview file calls.

I've switched to https://github.com/vinzscam/react-native-file-viewer as there's an onDismiss param.

This enables me to StatusBar.setBarStyle before and after opening a file.