[ShareExtension-macOS] the share menu cannot display my extension

  • I tried to configure the info.plist file in two ways, but some files cannot be shared through the share menu.

  • The files that cannot be shared are .txt, .js, .html, .sh, etc. 

  • The files that can be shared are .zip, .png, .mp4, .doc, .xls, etc.

Code Block
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>TRUEPREDICATE</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
<key>NSExtensionPrincipalClass</key>
<string>ShareViewController</string>
</dict>

Code Block
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationRule</key>
<key>NSExtensionActivationSupportsAttachmentsWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsAttachmentsWithMinCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsText</key>
<false/>
</dict>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
<key>NSExtensionPrincipalClass</key>
<string>ShareViewController</string>
</dict>


Answered by Qixin in 654160022
Code Block xml
<key>NSExtensionActivationSupportsAttachmentsWithMinCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsText</key>
<false/>

Delete these configurations first, and restart the computer, it will be displayed in the sharing menu.
After testing, I found that when my system language is set to English, files such as .txt, .sh can be shared, but when I set the system language to Chinese, they cannot be shared
Accepted Answer
Code Block xml
<key>NSExtensionActivationSupportsAttachmentsWithMinCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsText</key>
<false/>

Delete these configurations first, and restart the computer, it will be displayed in the sharing menu.
[ShareExtension-macOS] the share menu cannot display my extension
 
 
Q