实施到我的应用程序的深层链接后,应用程序图标不会出现 [英] App icon doesn't appear after implementing deep links to my app

查看:30
本文介绍了实施到我的应用程序的深层链接后,应用程序图标不会出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Android Studio 中开发一个应用程序,它运行良好,但是在实现到我的启动活动的深层链接后,我的应用程序不是菜单中的应用程序图标,我知道该应用程序是在设置>应用程序中安装的原因它出现.我知道问题出在 manifest.xml 中,所以我会在下面留下一份副本.

I'm developing an app in Android Studio it works pretty well, but after implementing deep links to my launching activity my app doesn't you the app icon in the menu, I know the app is installed cause in Setting>Applications it appears. I know the problem is in the manifest.xml, so I'll leave a copy down bellow.

顺便说一下,如果您正在阅读本文,我很想听听您的解决方案.

I'll love to hear about your solutions, by the way if you are reading this thanks.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.dev.misterj.nocherd">

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permision.CALL_PHONE"/>
    <uses-permission android:name="android.permission.MANAGE_OWN_CALLS"/>
    <uses-permission android:name="android.permission.READ_CALL_LOG"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>


    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="AIzaSyAiJNpq-********************" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:usesCleartextTraffic="true"
        android:networkSecurityConfig="@xml/network_security_config"
        android:theme="@style/AppTheme">

        <activity android:name=".StartActivity">
            <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" />

                <!-- Accepts URIs that begin with "https://myapp.com/place" -->
                <data android:scheme="https" android:host="myapp.com"  android:pathPrefix="/place"  />
                <!-- Accepts URIs that begin with "myapp://place" -->
                <data android:scheme="myapp" android:host="place" />
            </intent-filter>
        </activity>


        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
        </activity>


</manifest>

推荐答案

你应该分离意图过滤器,而且你的清单文件格式不正确.你应该关闭应用程序标签.您可以使用谷歌浏览器等外部应用程序打开它,它会告诉您 XML 的格式是否不正确.

You should separate the intent filters, also your manifest file is not well-formatted. you should close the application tag. you can open it with an external application like google chrome, it will tell you if the XML is not in correct format.

<activity android:name=".StartActivity">
    <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="myapp" android:host="place"/>

    </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="https" android:host="myapp.com" android:pathPrefix="/place" />
      </intent-filter>
</activity>

当您打算声明唯一的 URL(例如方案和主机的特定组合)时,创建单独的过滤器很重要,因为同一意图过滤器中的多个 元素实际上是合并在一起以解释其组合属性的所有变化.如果将它们结合起来,它实际上支持 https://place 并且还支持 myapp://myapp.com/place.所以你应该把它们分开.

it's important that you create separate filters when your intention is to declare unique URLs (such as a specific combination of scheme and host) because multiple <data> elements in the same intent filter are actually merged together to account for all variations of their combined attributes. if you combine them it actually supports https://place and also supports myapp://myapp.com/place. So you should separate them.

这篇关于实施到我的应用程序的深层链接后,应用程序图标不会出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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