capacitor-filesharer icon indicating copy to clipboard operation
capacitor-filesharer copied to clipboard

Bug: iOS: Preview panel showing up for PDF instead of the "Share" modal

Open davidmarquis opened this issue 4 years ago • 15 comments

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

davidmarquis avatar Jul 02 '20 20:07 davidmarquis

Here's a screenshot of the preview panel that shows up:

image

davidmarquis avatar Jul 02 '20 20:07 davidmarquis

Hi,

I tested it with iOS 13+ and it always works. What ios version do you use?

BR

moberwasserlechner avatar Sep 18 '20 11:09 moberwasserlechner

Up! I'm having the exact same issue. I'm on iOS 13.7

Rosadojonathan avatar Oct 02 '20 08:10 Rosadojonathan

I have the same bug with an png image.

SayWhat69 avatar Nov 21 '20 12:11 SayWhat69

Same issue here. Previews the PDF instead of opening the share options.

NikJaySix avatar Nov 29 '20 23:11 NikJaySix

Same here for CSV data and iOS 14.4. I see only fullscreen preview with my CSV.

kams2160 avatar Mar 22 '21 22:03 kams2160

I fixed it by installing the pods with the command pod install inside the .xcodeproj folder

FeoSilva avatar Apr 09 '21 00:04 FeoSilva

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.

zack1013 avatar Apr 14 '21 09:04 zack1013

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.

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

FeoSilva avatar Apr 14 '21 14:04 FeoSilva

+1 I have the same issue with a jpg

nik736 avatar Apr 17 '21 15:04 nik736

I had same problem, it fixed after npx cap sync.

berkayyildiz avatar Jul 10 '21 04:07 berkayyildiz

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);

MajorPrime avatar Jul 26 '21 21:07 MajorPrime

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

moberwasserlechner avatar Sep 23 '21 16:09 moberwasserlechner

I am currently developing on Capacitor 2.4 and it still has the exact same issue. I already tried the solutions above.

Hanho-Kim avatar Mar 27 '22 07:03 Hanho-Kim

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.

Hanho-Kim avatar Mar 30 '22 07:03 Hanho-Kim

Closed as outdated.

moberwasserlechner avatar Sep 18 '22 18:09 moberwasserlechner