iOS共享扩展名不适用于图片网址
我有一个使用这些规则的共享扩展名:
I have a share extension that uses those rules:
<dict>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsText</key>
<integer>1</integer>
</dict>
它非常适合普通网站和图像,但我无法解析这样的图像网址:( http://www.zappos.com/images/z/3/3/5/4/0/3/3354034-p-2x. jpg ).我累了添加其他规则,但是当我使用Safari打开此网站并单击共享时,我的共享扩展名仍然不会出现.
It works perfectly for normal websites and images but I can't parse image urls like this : ( http://www.zappos.com/images/z/3/3/5/4/0/3/3354034-p-2x.jpg ). I tired to add other rules but still my share extension won't appear when I open this website with Safari and click share.
但是,如果我将规则设为TRUEPREDICICATE,则我的共享扩展名可以解析该网站.
But if I make rule TRUEPREDICATE, my share extension can parse the site.
我做错了什么? 谢谢
基于wj2061的答案,以下谓词将获取主机应用程序提供的所有附件.
Building off of wj2061's answer, the following predicate will grab any and all attachments supplied by the host app.
<key>NSExtensionActivationRule</key>
<string>SUBQUERY (
extensionItems,
$extensionItem,
SUBQUERY (
$extensionItem.attachments,
$attachment,
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.item" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.content"
).@count == $extensionItem.attachments.@count
).@count > 0
</string>