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.
On iOS, UIActivityViewController provides a unified interface for users to share and perform actions on strings, images, URLs, and other items within an app. You create a UIActivityViewController by passing in the items you want to share and any custom activities you want to support (we’ll show how to do that later on).
By default, UIActivityViewController shows all the activities available for the items provided, but you can exclude certain activity types via the excludedActivityTypes property. Activity types are divided up into “action” and “share” types:
As a user, you just click the more button to show the ones you want in the share sheet. As a developer, you don’t have to do anything to your UIActivityViewController to show custom Share and Action Extensions. Apple made sharing from your apps incredibly easy with the addition of UIActivityViewController.
With DecodeRestorableState (NSCoder), allows custom state restoration. With BeginAppearanceTransition (Boolean, Boolean), tells child UIViewController s that their child views have just appeared or disappeared. The array of child UIViewController objects that should be searched to determine if they are the unwind segue destination.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With