我在iOS9中有两种不同的情况进行共享扩展时出现问题( 与iOS8一起正常工作 )---( 想要分享PDF ):
首先使用PDF附件邮件转发邮件应用
registeredTypeIdentifiers: ( "public.file-url", "com.adobe.pdf" )
registeredTypeIdentifiers: ( "com.adobe.pdf" )
我应该怎样做才能在第二个场景中获得" public.file-url" 。
See the screen short of 2nd scenario
我在plist中使用下面提到的SUBQUERY:
SUBQUERY (
extensionItems,
$extensionItem,
SUBQUERY (
$extensionItem.attachments,
$attachment,
(
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.file-url"
|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.adobe.pdf"
|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image"
|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.png"
|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg"
|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg-2000"
)
).@count == $extensionItem.attachments.@count
).@count == 1
答案 0 :(得分:0)
为分享扩展制作自定义文档类型 在关键的NSExtensionActivationRule下编写谓词 例如:for pdf&我使用最大文档数量的谓词制作的图像为1。
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>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.plain-text"
|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.png"
|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg"
|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg-2000"
)
).@count == $extensionItem.attachments.@count
).@count == 1</string>