I am working on Share Extension
Here is code of info.plist file . this is working fine in Safari, But not in Chrome.
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>0</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
Any idea? how to enable share extension in Chrome as well
Export Chrome Extensions as CRX Files If you want to export Chrome extensions manually, you have to enable 'Developer mode' in the browser and pack the extension in a CRX file. CRX is a file that Chrome automatically downloads and installs when you add an extension.
Getting Started With Fixing Chrome Extensions To do that, navigate to More Tools > Task Manager. In the task manager, locate the extension and tap End Process. This will disable the extension from the browser. Now, go to More Tools > Extensions and give the extension a fresh start by tapping on Reload.
To view the permissions of any installed extension, unpacked or from the store, open chrome://extensions page and click the details button on that extension's card. The circled part is for API permissions.
You are missing some code . For chrome you need to pass js file as well
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
<key>NSExtensionJavaScriptPreprocessingFile</key>
<string>DemoPreprocessor</string>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
for more detials Please visit demo extension code from this link
in my case, only adding the JS file with "NSExtensionJavaScriptPreprocessingFile" did not solve the problem.
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionJavaScriptPreprocessingFile</key>
<string>Action</string>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
It's also essential to add the :
<key>NSExtensionActivationSupportsText</key>
<true/>
I currently don't know why.
I've found this in the official documentation : NSExtensionActivationSupportsText : Include this key to indicate to the system and to other apps that your app supports text.
Thanks a lot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With