-
Notifications
You must be signed in to change notification settings - Fork 1.6k
openDocument not working on iOS #158
Comments
I'm not iOS developer but I changed presentOpenInMenuFromRect:rootCtrl.view.bounds inView:rootCtrl.view to presentOptionsMenuFromRect:rootCtrl.view.bounds inView:rootCtrl.view And now it's working. |
@raminious , thanks for the information, I'll try to change the implementation 👍 |
Thanks @wkh237 |
Thanks for the advice, if the naming is confusing, I think it's okay to change their name 😄 I'll make these changes and publish another package to npm. |
@raminious , I've published |
Thanks @wkh237 |
One more very important thing... the path must have an extension on the end or it won't work. e.g. RNFetchBlob.ios.openDocument('path/to/file.ext'); the same is true for previewDocument( ). If your path doesn't have an extension, you can append the extension type on the end of the path using the .config method: RNFetchBlob
.config({
fileCache: true,
appendExt: 'jpg', // only append an extension if the res.path() does not return one
})
.fetch('GET', attachmentUrl, {
Authorization: AuthorizationStore.getAuthHeaderValue(),
})
.then((res) => {
// console.log(res.path()) // uncomment this to check if your path has an extension on the end of it
if (Platform.OS === 'ios') {
RNFetchBlob.ios.openDocument(res.path()); // results in path/to/file.jpg
}
}); I filed the same issue here: #195 |
hi @raminious |
path sent to unlink is now checked for file prefix.
RNFetchBlob.ios.openDocument: Not worked without throwing any error. it only return null result on success promise.
It also not throw error when file is not exists.
iOS: 10 (simulator)
react-native: 0.34.1
path: /Users/raminious/Library/Developer/CoreSimulator/Devices/AFCFB1EA-23C3-4B77-961C-CC431B55D4CF/data/Containers/Data/Application/324FD0EB-73B7-4EE7-9254-3C4B67857D92/Documents/myvid.mp4
The text was updated successfully, but these errors were encountered: