swiftshare-extensionios11.1.1

My app is not showing up in Share Sheet


I integrated share extension in my application. This is my plist file for share extensions.

<key>NSExtension</key>
    <dict>
        <key>NSExtensionAttributes</key>
        <dict>
            <key>NSExtensionActivationRule</key>
            <string>TRUEPREDICATE</string>
        </dict>
        <key>NSExtensionMainStoryboard</key>
        <string>MainInterface</string>
        <key>NSExtensionPointIdentifier</key>
        <string>com.apple.share-services</string>
    </dict>

I am receiving warning in Xcode that if I use Truepredicate then apple will reject my application. So I tried adding other activation rule as mentioned below

<key>NSExtensionAttributes</key>
    <dict>
        <key>NSExtensionActivationSupportsImageWithMaxCount</key>
        <integer>1</integer>
        <key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
        <integer>1</integer>
    </dict>
    <key>NSExtensionMainStoryboard</key>
    <string>MainInterface</string>
    <key>NSExtensionPointIdentifier</key>
    <string>com.apple.share-services</string>
    </dict>

But if I remove Truepredicate and add above rules my share extension does not show any more. With truepredicate share extensions works perfectly fine. Can anyone help me what should I do here? I had integrated share extensions for music related apps.


Solution

  • There was mistake in My Plist file that's why was facing such issue.

    Posting this answer just because may be in future if someone will do such mistake so my answer could help out!

    <key>NSExtension</key>
        <dict>
            <key>NSExtensionAttributes</key>
            <dict>
                <key>NSExtensionActivationRule</key>
                <dict>
                    <key>NSExtensionActivationSupportsText</key>
                    <true/>
                    <key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
                    <integer>1</integer>
                    <key>NSExtensionActivationSupportsImageWithMaxCount</key>
                    <integer>1</integer>
                </dict>
            </dict>
            <key>NSExtensionMainStoryboard</key>
            <string>MainInterface</string>
            <key>NSExtensionPointIdentifier</key>
            <string>com.apple.share-services</string>
        </dict>
    

    This is working perfectly fine!