我的共享扩展有以下 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
以便排除特定类型的文件。
感谢
礼
<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)
| 归档时间: |
|
| 查看次数: |
1104 次 |
| 最近记录: |