I want to implement an app extension, but I can't decide if I should implement it as a Share Extension or Action Extension.
The documentation doesn't say much about the differences, just this:
Are there technical differences as well (e.g. does an Action extension allow me to do something that the Share extension doesn't), or is it merely a convention Apple wants you to follow to make things less confusing to users?
It seems that at least one difference is that if you want a non-UI action, you must choose an Action instead of Share extension.
What are the other differences?
Examples of things I'm looking for:
Share Extension is an easy way that Apple provides to share contents (images, audio, files, etc.) from one app to another, even made by different developers.
An Action extension helps users view or transform content originating in a host app. For example, an Action extension might help users edit an image in a document that they're viewing in a text editor.
ipa. An . ipa (iOS App Store Package) file is an iOS application archive file which stores an iOS app.
The Share Button. The location of the Share button will change based on the app, but it is usually either at the top of the screen or the bottom of the screen. The standard Share button is a box with an arrow pointing out the top. It is usually blue, but some apps use different colors.
Here are my findings so far:
Share extensions get a colored icon, which is the same one as your app's main icon. In fact, Apple states: "If you provide a separate icon in your Share extension target, Xcode ignores it."[B]
Action extensions use "a monochromatic version of the app icon,"[E] or "a template image version"[B] of your app icon.
Share extensions appear in the middle row, action extensions appear on the bottom row.
Depending on the app being targeted, your icon may be competing with more or less icons as an share vs. action extension. For example, if users are going to access your extension through Safari mainly, your app would be competing with 4 other icons by default as a share extension*, or 8 other icons as an action extension. On the other hand, if you are targeting the Maps app, you would be competing with more icons as a share extension (4) rather than an action extension (2).
Therefore, to maximize your exposure to the user you would want to choose a share extension when targeting Safari, but an action extension when targeting Maps.
Note: Most of the activities are provided by the host app itself using the UIActivity and UIActivityViewController APIs. There is a great write-up about them on NSHipster.
*Obviously the number of share and activity extensions change depending on the installed apps and which the user chose to show/hide.
(Italics means the icons can be hidden.)
The default Share extension template comes with a subclass of SLComposeServiceViewController to keep things consistent. And Apple wants you to "use the system-provided UI in a Share extension [as much as possible]."[E]
Action extensions, on the other hand, allow you to choose an Action Type (Presents User Interface or No User Interface), with the former coming with a blank UIViewController.
Default share extension; Default Presents User Interface Action extension.
Although Apple states that a Share extension should "post to a sharing website or share content with others,"[A] even they violate this requirement with Reminders.
Action extensions are meant to "manipulate or view content originating in a host app."[A]
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