iOS 11 share extension not appear in UIActivityViewController

I use Swift 4 & XCode 9 beta 5. In ShareExtension plist, I set the NSExtensionActivationRule as followed, our app will not show in theUIActivityViewController in Photo sharing.


<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
            <string>SUBQUERY (
                extensionItems,
                $extensionItem,
                SUBQUERY (
                $extensionItem.attachments,
                $attachment,
                ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image"
                ).@count >= 1
                ).@count > 0</string>
</dict>



If I change the NSExtensionActivationRule to something like this, it works well.


<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsAttachmentsWithMaxCount</key>
<integer>20</integer>
</dict>


If anyone has similar issues or already knowns how to use SUBQUERY in NSExtensionActivationRule, I would be very thankful.

Replies

For me, share extensions using predicates stopped working after enabling the new build system (preview) in Xcode 9.0. Reverting to the standard build system (default) fixed the issue.


Xcode 9.1 (currently in beta) seems to work fine even with the new build system.