我想启用我的应用程序来共享地图位置,但我不知道在我的应用程序中启用它的关键是什么,所以如果有人为地图实现共享扩展,请帮助我。
我看到下面的链接但无法理解。 iOS add share extension on maps
答案 0 :(得分:0)
基本上,Tom Harrington说你可以获得位置卡或位置URL。
要获取位置网址, 制作" NSExtensionActivationRule"键类型为"字符串"并在值中添加Tom Harrington给出的SUBQUERY。
此处,所有扩展项都会通过此查询并在UIActivityView中显示您的扩展,如果您的查询符合扩展项。
您的Info.Plist应如下所示:
<Key>NSExtensionActivationRule</key>
<string>SUBQUERY(extensionItems,$extensionItem,SUBQUERY($extensionItem.attachments,$attachment,SUBQUERY($attachment.registeredTypeIdentifiers, $uti, $uti UTI-CONFORMS-TO "public.url" AND NOT $uti UTI-CONFORMS-TO "public.file-url").@count >= 1).@count >= 1).@count >= 1</string>
如果您还想支持其他UTType,请使用OR并添加其他SUBQUERY。
希望能帮助。
答案 1 :(得分:0)
与多种类型共享扩展程序,包括位置
<key>NSExtensionActivationRule</key>
<string>SUBQUERY(extensionItems, $extensionItem, SUBQUERY($extensionItem.attachments, $attachment, ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.plain-text").@count >= 1).@count >= 1
OR SUBQUERY(extensionItems, $extensionItem, SUBQUERY($extensionItem.attachments, $attachment, SUBQUERY($attachment.registeredTypeIdentifiers, $uti, $uti UTI-CONFORMS-TO "public.url" AND NOT $uti UTI-CONFORMS-TO "public.file-url").@count >= 1).@count >= 1).@count >= 1
OR SUBQUERY(extensionItems,$extensionItem,SUBQUERY($extensionItem.attachments,$attachment,ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image").@count == $extensionItem.attachments.@count AND $extensionItem.attachments.@count <= 5).@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 <= 5).@count == 1
OR SUBQUERY(extensionItems,$extensionItem,SUBQUERY($extensionItem.attachments,$attachment,ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.content").@count == $extensionItem.attachments.@count AND $extensionItem.attachments.@count <= 1).@count == 1
</string>
</dict>