iOS 共享扩展中的 SUBQUERY 排除文件类型

rez*_*a23 3 typeid ios

我的共享扩展有以下 NSExtensionActivationRule,它允许我的应用程序与图像和 pdf 文件交互:

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
Run Code Online (Sandbox Code Playgroud)

但是,当我使用不同的方法访问我自己的文件时,我需要不为我的应用程序文档类型的文件显示我的应用程序com.myApp.extension。
是否有任何改进:

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

以便排除特定类型的文件。

感谢
礼

Par*_*. P 5

<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>
Run Code Online (Sandbox Code Playgroud)