我所做的所有共享扩展工作都很好,但我需要假设
- 如果我点击多个视频不想在共享列表中显示我的应用程序。
如果我只想在图像或视频的情况下显示我的应用程序。(不是图像和视频。)。我在 .plist 中使用以下查询
<dict> <key>NSExtensionActivationRule</key> <string>SUBQUERY ( extensionItems, $extensionItem, SUBQUERY ( $extensionItem.attachments, $attachment, ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" ).@count <= 10).@count >= 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 >= 1).@count >= 1).@count >= 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 <= 1 ).@count == 1 </string> </dict>
以上查询适用于图像,但没有 public.movie
人可以帮助我。并且共享扩展在所有类型中都是可见的。即电子名片、联系人等我只需要文本、照片和视频。