0

I want to enable My application to share map location but I don't know what key for that to enable it in my application, So please help me if any one implement share extension for map.

I was see below link but not able to understand. iOS add share extension on maps

Community
  • 1
  • 1
Dipen Chudasama
  • 3,063
  • 21
  • 42

2 Answers2

0

Basically, Tom Harrington was saying that you can get location card or location URL.

To get the location URL, Make "NSExtensionActivationRule" Key type as "String" and in the value add the SUBQUERY given by Tom Harrington.

Here, All the extension Item go through this Query and shows up your extension in the UIActivityView, If your query conforms with the Extension Item.

Your Info.Plist should look something like this:

<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 &gt;= 1).@count &gt;= 1).@count &gt;= 1</string>

If you want to support other UTTypes as well, Then use OR and add other SUBQUERY.

Hope that Helps.

0

Share extension with multiple types including location

 <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 &lt;= 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 &lt;= 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 &lt;= 1).@count == 1
        </string>
</dict>