capacitor-filesharer
capacitor-filesharer copied to clipboard
Bug: iOS: Preview panel showing up for PDF instead of the "Share" modal
Capacitor version:
Latest Dependencies:
@capacitor/cli: 2.2.1
@capacitor/core: 2.2.1
@capacitor/android: 2.2.1
@capacitor/electron: 2.2.1
@capacitor/ios: 2.2.1
Installed Dependencies:
@capacitor/electron not installed
@capacitor/cli 2.0.2
@capacitor/android 2.0.2
@capacitor/ios 2.0.2
@capacitor/core 2.0.2
[success] Android looking great! 👌
Found 5 Capacitor plugins for ios:
@byteowls/capacitor-filesharer (2.0.0)
cordova-plugin-actionsheet (2.3.3)
cordova-plugin-badge (0.8.8)
cordova-plugin-dialogs (2.0.2)
uk.co.workingedge.phonegap.plugin.launchnavigator (5.0.4)
[success] iOS looking great! 👌
Library version:
- 2.0.0
Your Plugin Configuration
FileSharer.share({
filename: file.name, // contains "invoice_0002.pdf"
base64Data: base64, // verified that this contains valid base64 encoded data
contentType: file.type, // contains "application/pdf"
}).catch(error => {
console.error('File sharing failed', error.message);
});
Affected Platform(s):
- iOS
Current Behavior
When I invoke the plugin, the PDF file gets displayed in some sort of PDF preview UI instead of the Share activity modal. The PDF renders as expected, which means the data itself is OK but somehow there's no Share modal at all and there's also no way to close that preview panel.
Expected Behavior
I would have expected the Share modal to be displayed as such: https://youtu.be/p7f6yamZxCk?t=762
Sample Code or Sample Application Repo
See above.
Other Information
The iOS logs are only showing this:
WebView loaded
Here's a screenshot of the preview panel that shows up:
Hi,
I tested it with iOS 13+ and it always works. What ios version do you use?
BR
Up! I'm having the exact same issue. I'm on iOS 13.7
I have the same bug with an png image.
Same issue here. Previews the PDF instead of opening the share options.
Same here for CSV data and iOS 14.4. I see only fullscreen preview with my CSV.
I fixed it by installing the pods with the command pod install
inside the .xcodeproj folder
I fixed it by installing the pods with the command
pod install
inside the .xcodeproj folder
may i have more detail how to fix that? thanks.
I fixed it by installing the pods with the command
pod install
inside the .xcodeproj foldermay i have more detail how to fix that? thanks.
After installed the dependency (npm i @byteowls/capacitor-filesharer
or yarn add @byteowls/capacitor-filesharer
), open the terminal in the folder where is .xcodeproject file and run the command pod install
+1 I have the same issue with a jpg
I had same problem, it fixed after npx cap sync
.
We had this issue despite already using cap sync
For us, we had to register the plugin (in index.tsx
where we call ReactDOM.render
)
(cordova v2.4)
import {FileSharer} from '@byteowls/capacitor-filesharer';
import {registerWebPlugin} from '@capacitor/core';
registerWebPlugin(FileSharer);
I released the new version 3.0.0
today
If you can and it is still relevant please test this issue with the new version. (Capacitor 3.0.0 required)
I keep this issue open a few days and close it afterwards if there is no feedback.
BR Michael
I am currently developing on Capacitor 2.4 and it still has the exact same issue. I already tried the solutions above.
For those who are developing on capacitor 2.0,
FileSharer.share({...})
=> Not working as intended. Some previewing webview is appeared without any failed/error message. (This should be fixed for preventing confusion)
Plugins.FileSharer.share({...})
=> Working fine.
Closed as outdated.