为什么我的应用程序在安装后没有显示在图标网格(不是启动器)中



我最近开始测试我的 react-native android 应用程序,并注意到它在安装时没有创建应用程序图标。 当我调试时 - 它似乎安装并运行良好,但是当我在应用程序图标中查找它以启动时 - 它没有显示。 查看已安装的应用程序列表,它就在那里。 我该如何调试? 我是否需要将启动模式从singleTop更改为其他模式? 我尝试将其更改为singleInstance,但它仍然存在相同的问题。 如果我删除一些意图过滤器,它似乎可以工作 - 所以也许我搞砸了 branch.io 安装说明? 我是否需要为其他意向创建单独的意向过滤器 xml 节点? https://dev.branch.io/getting-started/sdk-integration-guide/guide/react/#android-configure-manifest

安卓清单.xml

<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:launchMode="singleTop"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="www.foo.com"
android:pathPrefix="/event" />
<!-- note that the leading "/" is required for pathPrefix-->
<data android:scheme="fooapp" android:host="open" />
</intent-filter>
<intent-filter>
<action android:name="fcm.ACTION.EVENT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

更新

拆分意图过滤器似乎已经解决了它 - 但有点不清楚这是否是正确的做法。 在 branch.io 说明中 - 他们的意思是让我创建一个新的意图过滤器而不是添加到现有的主过滤器中?

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="www.foo.com"
android:pathPrefix="/event" />
<!-- note that the leading "/" is required for pathPrefix-->
<data android:scheme="fooapp" android:host="open" />
</intent-filter>

启动器通常是由各个硬件制造商开发的特定软件。在我拥有的所有设备上,当应用程序不是从 Play 商店安装时,它不会安装在主屏幕上,但它确实显示在应用程序列表中。但是,我认为该行为将特定于您使用的启动器。

您不需要转到设置>应用程序只是为了看到它。这就是你遇到的问题吗?

也许屏幕截图以及测试设备的描述会使问题更清晰。

更新。。。。

通常,启动活动有一个只有 MAIN 和 LAUNCHER 的意图过滤器。我只是尝试从该意图过滤器中删除其他内容,看看是否可以解决问题。然后,逐个添加您列出的其余内容,直到确定有问题的孩子。

再看一遍,我不确定是否可以在单个事件过滤器中定义 2 个操作。所以你似乎需要删除视图。

最新更新