【问题标题】:Android-10 DeepLink is not working, but works below android 10 versionsAndroid-10 DeepLink 不工作,但在 android 10 版本以下工作
【发布时间】:2020-08-22 16:49:01
【问题描述】:

我正在开发一个 android 应用程序,我正在使用深层链接 url 盯着登录活动 这是我正在使用的意图。

  <activity android:name="Login_User"
        android:screenOrientation="portrait">
        <intent-filter
            android:autoVerify="true">
            <action android:name="android.intent.action.VIEW"></action>

            <category android:name="android.intent.category.DEFAULT"></category>
            <category android:name="android.intent.category.BROWSABLE"></category>

            <data
                android:host="www.mySite.com"
                android:path="/launch.php"
                android:scheme="http"
               ></data>
            <data
                android:host="www.mySite.com"
                android:path="/launch.php"
                android:scheme="https" />

        </intent-filter>
    </activity>

此代码适用于除 android 10 之外的所有 android 版本, 我应该怎么做才能让它在 android 10 上运行。我找不到专门针对 android 10 的东西。 谢谢。

【问题讨论】:

    标签: android deep-linking androidx android-10.0 deeplink


    【解决方案1】:

    我认为您之前执行过类似“scheme://host/path”的内容,但我相信 Chrome 无法处理 Android 10 及更高版本的 URI 方案。这是现在推荐的方案:

    intent://host/path#Intent;scheme=scheme;package=com.example.app.package;end

    请参阅此参考:https://developer.chrome.com/multidevice/android/intents

    我还发现 this tool handy 在我的移动设备上查看工作示例。对于您的应用,您可以尝试从 javascript 或网络浏览器启动此 URL:

    intent://www.mySite.com/launch.php#Intent;scheme=http;package=your.app.package;end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-20
      • 2022-07-05
      • 1970-01-01
      • 2021-06-24
      • 1970-01-01
      相关资源
      最近更新 更多