Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS Share extension: how to read from notes posts

I want my app to be able to parse text from notes app post as well other text editors posts, so i created an share extension target. Everything worked fine until i prepare the app for publish, replacing the TRUEPREDICATE by NSExtensionActivationRule.

Supposedly, in my share extension target, i should add NSExtensionActivationSupportsText key to NSExtensionActivationRule in info.plist, which i did, but still my app extension doesn't show up in the share sheet.

According to https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html my info.plist should contain this:

<key>NSExtensionAttributes</key>
<dict>
   <key>NSExtensionActivationRule</key>
   <dict> 
        <key>NSExtensionActivationSupportsText</key>
        <integer>1</integer>
   </dict>
</dict>

I try enable also other types like attachments, files, web pages, but had no effect.

like image 308
MiguelSlv Avatar asked Dec 31 '15 15:12

MiguelSlv


1 Answers

At least in iOS 9, the correct code is

<dict>
    <key>NSExtensionActivationSupportsText</key>
    <true/>
</dict>

For reference, this is typically what it would like for text share extension support:

<key>NSExtensionAttributes</key>
<dict>
    <key>NSExtensionActivationUsesStrictMatching</key>
    <integer>2</integer>
    <key>NSExtensionActivationRule</key>
    <dict>
        <key>NSExtensionActivationDictionaryVersion</key>
        <integer>2</integer>
        <key>NSExtensionActivationSupportsText</key>
        <true/>
    </dict>
</dict>
like image 121
GetSwifty Avatar answered Oct 17 '22 04:10

GetSwifty