8

I am trying to remove my own applications share extension from showing up in the share options. I can't find any documentation on this online. Any help would be appreciated.

This is what I have so far:

activityVC.excludedActivityTypes = [UIActivityTypeAirDrop, UIActivityTypeAddToReadingList,"com.Final.Giftr.Giftr-ShareExtension"]

The Air drop and add to reading list are working as expected.

onemillion
  • 682
  • 5
  • 19

1 Answers1

2

You want to look into NSExtensionActivationRule, in your share extension's Info.plist. At a high level, you want to additionally share an item with a custom UTI, and make your share extension exclude that UTI.

Check out this blog post from the PSPDFKit team.

However, as a caveat, PSPDFKit have stopped using this approach, since some third party extensions will only activate if they can share every item that is being presented… in the case of this approach, it would mean that some third party extensions would not show up. See the update at the bottom of the blog post.

Amy Worrall
  • 16,250
  • 3
  • 42
  • 65