na drugie pytanie nie możemy w 100% pewien, że tylko Twoja aplikacja może uruchomić na określonym rozszerzenie aplikacji, która jest całkowicie kontrolowany przez użytkownika ale możemy kontrolować, na których udokumentowano chcesz pokazać aplikacja rozszerzenie śledzić Declaring Supported Data Types for a Share or Action Extension
aby typ dokumentu Dostosuj dla orzeczników pisać pod klucz NSExtensionActivationRule na przykład: dla pDF, obrazów i dokumentów excel zrobiłem następujące predykaty z maksymalną ilością dokumentów do 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"
|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.microsoft.excel.xls"
|| ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "org.openxmlformats.spreadsheetml.sheet"
)
)[email protected] == [email protected]
)[email protected] == 1</string>