3

What I want to archive in the end, is the possibility for the user to open every single file in my app.

So I went ahead and added public.data and public.content as Supported Document Types as described here: https://www.cocoanetics.com/2013/01/open-in-all-files/ This works find for most files.

But now I have f.e. an email with an image in it, and my app will not appear in the Share-Sheet thinggy. I already figured out, that creating a ShareExtension would solve the problem of my app not showing up.

But ideally, my app would then also start (like the Create PDF in iBooks Share-Extension works. I need that, cause when the user want's to "open" a file using my app, we should be able to decide what to do with it.

It wouldn't be super bad if that doesn't work, but would be nice...

Georg
  • 3,664
  • 3
  • 34
  • 75

1 Answers1

1

System doesn't technically opens your app when user taps on an icon of a ShareExtension. What ShareExtension is - a small binary that's separate from your container (main) iOS app.

Those apps, that appear in activity controller as share extensions, implement a special UI just for that share extension, instead of being opened when user taps on it.

You can implement a share extension that would store files to your main app documents dir or webserver or whatever.

You start by adding a target for the extension and then implement a view controller either from scratch or by inheriting from SLComposeServiceViewController

You can start at this wwdc video

Dannie P
  • 4,464
  • 3
  • 29
  • 48
  • 1
    Totally forgot about that question I once asked :) In the meantime I already implemented a share-extension that does exactly what I wanted! Thank you for your answer though! – Georg Jan 30 '18 at 07:20
  • 1
    Yeah, that's almost 2 years since the date you've asked that, quite a bit of time :) I thought it might be useful for somebody anyways, thanks for accepting! – Dannie P Jan 30 '18 at 17:04