Sharing Options

Hi, I’m looking to use @capacitor/share for displaying share options for a PDF in app.

The default simply gives me Messages, Reminders, and a copy option.

What actually determines what options are shown there?

For example, if I want print, email, or download option to show up on iOS… is there a means to force those options to show up? Is it dependent on the file type? How does iOS determine (assuming that’s the underlying means) what options show up there?

Things like “Print” and “Save to Device” are available by scrolling down and selecting the option instead of in the horizontal list of icons. It uses the system level share option that iOS populates for the file type

@thomasvidas Thanks for the reply.

When I provide a URL to the file, I get the attached:

Is there something I’m missing in the options? It seems to recognize it as a PDF at the very least.

This is how I’m setting it (I’ve modified the actual URL in this example):

await Share.share({
  title: 'Share File',
  url: 'https://whatever.com/filename.pdf',
  dialogTitle: 'Share File',
});

tapping on the more or edit actions should show more options.

@Hills90210 Nope, just “Add to Reading List”

@johnorrmc3 are you running on a simulator or a real device? The limited options being show here make me think you’re on a simulator.

Testing this on a real device showed all of the expected share targets that you’ve listed.

@mhartington In a simulator. I’ll try deploying to my phone.

@mhartington Thanks for the suggestion. I do get additional options, but only ones relative to my personal apps. I still don’t get print or save to Files options.

I wondering if this is because it’s being treated as a URL and not a file? The file isn’t stored locally, so I can’t use the file:// protocol.

Is there a way to make this work with https?