-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Share extensions will *only* show up if they explicitly support *all* of the provided activity items #5
Comments
Some questions, specific to Tumblr: I used to use the |
If putting both an
We could certainly support this, by asking you to create an object with a custom UTI that we specifically look for, and pull whatever different types of metadata that we want out of it. However, the problem with this approach is that only the Tumblr extension will show app, for the very reasons outlined in this issue. Other share extensions won't explicitly support the custom UTI, and as such, won't be displayed in the activity controller. That said, we'd consider if there's enough demand for specialized, Tumblr-only activity controllers. I'd just be surprised if there was, is all.
This certainly sounds like a bug. I'll file a ticket and take a look, thanks for bringing this to my attention. |
Our container app with the share extension is iOS 8 only. Was this an issue with the last iOS 7 version? |
That all makes a ton of sense to me - for now I'll concat the link & tags in to the text description. I didn't think to check if the new Tumblr was iOS 8, but that should resolve the old version, I'll add the extension support and fall back to the old one on iOS 7! |
Did you ever have issues with the predicate simply being parsed incorrectly? I've written a very simple predicate string, yet the Photos app is miserably failing to evaluate it. For instance, you would assume this would allow my extension to be shown whenever a video file is being shared:
If you select a video in the photos app, and also select a photo that was taken after that video, the extension doesn't appear. However, here's the WTF part: if you select a video, and also a photo taken before that video, it does show up. I cannot come up with any reason why this would be the case, and unfortunately there doesn't seem to be a way to debug how the predicate is being parsed. I've tried with screenshots, photos from the back camera and the front camera, it doesn't seem to make a difference. The only difference is whether they were taken before or after the shared video. |
This is fixed in iOS 9, as per the App Extension Best Practices session 🎉. To opt your extension into OR instead of AND behavior, simply add the following key/value pair to your Info.plist:
|
Anyone know if the above is the actual behavior of the Tumblr app? I have an action extension that accepts an image, but cannot get it to show up when you long-press a photo. I’ve got NSExtensionActivationSupportsImageWithMaxCount = 1 and NSExtensionActivationDictionaryVersion = 2 in my Info.plist and my extension does appear when doing a similar share from Photos, Twitter, Flickr, etc. But Tumblr only seems to provide a public.url attachment type and nothing matching public.image. (And the link it provides is to the post, not a specific image.) So I’m just wondering if the above idea of providing an image, link, and text together is really being done or if that was just an example/idea and not actually how Tumblr provides activity items. Incidentally, the standard system “Save Photo” and “Copy” actions do appear from Tumblr, so somehow they know there is image data? |
You're right; that's not the behavior of the Tumblr app. In order to avoid having photo posts be unable to be shared by share extensions that do not explicitly support images, we opted for what we assumed to be the lowest common denominator for all share extensions: URLs. The system copy activity simply acts on the URL of the photo post; if you choose Copy and then paste in a text area, you'll see it's a URL. The "Save Photo" activity is trickier. Because the system save image activity will not show up based on a URL, we wrote our own custom save image activity that we use when long pressing photos. |
@irace It looks like this behaviour again changed in iOS 11. In Firefox for iOS we now have half baked sharing support because our original predicate stopped working. Have you seen anything prblematic with iOS 11? |
Sorry – it’s been years since I’ve dealt with share extensions.
…On Oct 18, 2017, 6:46 PM -0400, Stefan Arentz ***@***.***>, wrote:
@irace It looks like this behaviour again changed in iOS 11. In Firefox for iOS we now have half baked sharing support because our original predicate stopped working. Have you seen anything prblematic with iOS 11?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This is a doozy. It’s the most important issue we’ve found, and one that probably deserves a blog post of its own.
Here’s how applications pass data to share extensions:
UIActivityViewController
with an array of “activity items”Here’s how we think this should work, using the Tumblr app as an example:
What actually happens is that only share extensions that explicitly support images and URLs and text will show up.
This is a problem, because the simplest way to specify what your extension supports – and by far the best documented – is by adding
NSExtensionActivationRule
keys like:This looks like it would mean “show my extension as long as any of the activity items are text,” but it really means “show my extension as long as there is only one activity item, and it is text.”
Federico Viticci, who at this point has likely used more third-party share extensions than anyone else on the planet, verifies that this is in fact a legitimate problem:
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>Workaround
This negatively affects both app and extension developers. It means that:
SUBQUERY(extensionItems, $extensionItem, SUBQUERY($extensionItem.attachments, $attachment, ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image").@count <= 10).@count >= 1 OR
SUBQUERY(extensionItems, $extensionItem, SUBQUERY($extensionItem.attachments, $attachment, ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.text").@count >= 1).@count >= 1
The text was updated successfully, but these errors were encountered: