共享扩展名-自iOS 14以来首次尝试时应用程序未显示在共享菜单中 [英] Share extension - App not showing in share menu on first attempt since iOS 14

查看:59
本文介绍了共享扩展名-自iOS 14以来首次尝试时应用程序未显示在共享菜单中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在升级到Xcode 12和iOS 14之后,似乎开始出现奇怪的事情.

Something weird seems to start happening after upgrade to Xcode 12 and iOS 14.

应用以前曾在共享菜单选项中正常显示,但突然它运行异常,仅在第二次尝试之后才显示.

App use to show fine in share menu option before, but suddenly it is acting weirdly and only showing on second attempt onwards.

我的目的是获取网页URL.这是我的共享激活规则.

My aim is to get web page url. Here's my share activation rule.

我什至尝试了新项目,并使用上面的激活规则添加了共享扩展名.它也做同样的事情,并且应用程序仅在第二次以后才显示为共享选项.此问题主要发生在Safari中.

I have even tried on new project and added share extension with activation rule above. It also does the same, and app only show in share option from second time onwards. This issue mainly happening in Safari.

它曾经在iOS 14之前运行良好,我也没有在iOS 14更改日志中找到任何有关可能导致此问题的共享扩展的信息.谁能帮我指出哪里可能是错误的或某些可能的原因.

It used to work fine before iOS 14, i also didn't find anything in iOS 14 change log regarding share extension that can cause the issue. Can anyone help me pointing out where it could be wrong or some possible reason.

提前谢谢!

推荐答案

我们也遇到了这个问题,其配置与您的配置非常相似.最终切换到此配置,以使其始终显示:

We also ran into this issue and had a configuration that looked very similar to yours. Ended up switching to this configuration to get it consistently showing:

<dict>
    <key>NSExtensionAttributes</key>
    <dict>
        <key>NSExtensionActivationRule</key>
        <string>  SUBQUERY (
         extensionItems,
         $extensionItem,
         SUBQUERY (
            $extensionItem.attachments,
            $attachment,
            ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO &quot;public.url&quot;
           ).@count &gt; 0
         ).@count &gt; 0</string>
    </dict>
    <key>NSExtensionMainStoryboard</key>
    <string>MainInterface</string>
    <key>NSExtensionPointIdentifier</key>
    <string>com.apple.share-services</string>
</dict>

请注意,我们最初尝试使用 @count == 1 进行计数比较,但这在iOS 14上也不起作用.

Note we'd originally tried @count == 1 for the count comparisons but this also didn't work on iOS 14.

这篇关于共享扩展名-自iOS 14以来首次尝试时应用程序未显示在共享菜单中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆