0

all I am working on Share Extension working fine, But I need like suppose

  1. if I click more than one video don't want to show my App in share list.
  2. if I want to show my app only in case of image or video.(not image and video.). I am using below query in .plist

        <dict>
        <key>NSExtensionActivationRule</key>
        <string>SUBQUERY (
            extensionItems,
            $extensionItem,
            SUBQUERY (
            $extensionItem.attachments,
            $attachment,
            ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image"
            ).@count &lt;= 10).@count &gt;= 1
            OR
            SUBQUERY(extensionItems, $extensionItem, SUBQUERY($extensionItem.attachments, $attachment, SUBQUERY($attachment.registeredTypeIdentifiers, $uti, NOT $uti UTI-CONFORMS-TO "public.url" AND NOT $uti UTI-CONFORMS-TO "public.file-url" AND $uti UTI-CONFORMS-TO "public.plain-text").@count &gt;= 1).@count &gt;= 1).@count &gt;= 1
            OR
            SUBQUERY(extensionItems,$extensionItem,SUBQUERY($extensionItem.attachments,$attachment,ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.movie").@count == $extensionItem.attachments.@count AND $extensionItem.attachments.@count &lt;= 1 ).@count == 1
        </string>
        </dict>
    

above query working for images but not public.movie can anybody help me out. and also share extension is visible in all types. i.e. vcards, contacts etc I need only text, photo, and Video.

kalpesh satasiya
  • 799
  • 8
  • 18
Bittoo
  • 579
  • 7
  • 21

1 Answers1

0

Change count 10 to 1, in the below part of your subquery :

...
$attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image"
        ).@count &lt;= 10).@count &gt;= 1
...

to

...
$attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image"
        ).@count &lt;= 1).@count &gt;= 1
...

For rest of items movie, urls its fine.

byJeevan
  • 3,728
  • 3
  • 37
  • 60