Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SUBQUERY in iOS Share Extension Exclude file Types

Tags:

ios

typeid

I have the following NSExtensionActivationRule for my shared extension which allows my app to interact with images and pdf files:

SUBQUERY (
    extensionItems, $extensionItem,
    SUBQUERY (
        $extensionItem.attachments, $attachment,
        ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.adobe.pdf" ||
        ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" ||
        ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url"
    ).@count == 1
).@count > 0

However, as I use a different method to access my own files, I need for my app not to be displayed for files with my apps document type com.myApp.extension.
Is there anyway of refining:

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

so that it excludes files of particular type.

Thanks
Reza

like image 768
reza23 Avatar asked Dec 31 '25 19:12

reza23


1 Answers

<key>NSExtensionAttributes</key>
<dict>
    <key>NSExtensionActivationRule</key>
    <string>
    SUBQUERY (
        extensionItems,
        $extensionItem,
            SUBQUERY (
                $extensionItem.attachments,
                $attachment,
                (ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.adobe.pdf" OR
                ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.file-url" OR
                ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url" OR
                ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg" OR
                ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.png")
                AND NOT (ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "your.unique.uti.here")
            ).@count == $extensionItem.attachments.@count
    ).@count == 1
    </string>
</dict>
like image 91
Paresh. P Avatar answered Jan 03 '26 12:01

Paresh. P



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!