Skip to content

Instantly share code, notes, and snippets.

@madewulf
Forked from irace/gist:535c9aa3314ee41fb902
Last active August 29, 2015 14:06
Show Gist options
  • Save madewulf/49cc1dc4d8ee3ff21ddb to your computer and use it in GitHub Desktop.
Save madewulf/49cc1dc4d8ee3ff21ddb to your computer and use it in GitHub Desktop.

I'm not 100% sure this is all accurate but:

It seems as though share extension predicates are a lot more specific than we originally thought. For example, if Instapaper declares support for only NSExtensionActivationSupportsWebURLWithMaxCount = 1, this means that activity controllers configured with a URL but also some other item types too, e.g. a string, won't show Instapaper.

So basically if you have multiple items in your activity items array, your controller will only show extensions that support all types. I imagine this would be extremely limiting, and as such, think the best option is to:

  • Only include a single provider in your items array. The provider would have a placeholder of a single type that will be provided to any activity or extension that isn't specifically accounted for
  • In the provider, specifically hardcode alternative item types for activities that need an alternative to the placeholder type:
    • "Copy" activity could use photo data, if present
    • "Mail" activity would get a string to use as the message body

This sucks because we're limiting how useful sharing from our app is if we only export a single data type. But I'm not sure that there's a way to be any more accomodating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment