1

I have a share extension that is marked as supporting public.url attachments, and this works perfectly for regular web pages shared from mobile safari. However if you are viewing an image in mobile safari my share extension is not viewable even though the image is on a public url.

Does anyone know how to say you want to support anything with a public url?

János
  • 32,867
  • 38
  • 193
  • 353
Jozef Dransfield
  • 524
  • 4
  • 11

1 Answers1

1

Incase anyone has the same problem: You can change the NSExtensionActivationRule to the following:

SUBQUERY (
                extensionItems,
                $extensionItem,
                SUBQUERY (
                $extensionItem.attachments,
                $attachment,

                (
                           ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url"
                )

    ).@count == $extensionItem.attachments.@count
).@count == 1

Then you just need to iterate over the attachments until you find the one which is the public.url

Jozef Dransfield
  • 524
  • 4
  • 11
  • I don't think that's the correct answer. Safari somehow sends an attachment with the identifier `public.jpeg` when you just have an image open in Safari. Somehow `NSExtensionActivationSupportsImageWithMaxCount` doesn't fire on `public.jpeg` but only on `public.image`. Not sure how the query is supposed to look like, though. – denbec Jan 04 '17 at 08:56