简体   繁体   English

深度链接无法通过Intent Android工作

[英]Deeplinking not working via intents android

I am generating this share url 我正在生成此共享网址

http://domain.be/app_name/users/shareItem/MTY1 http://domain.be/app_name/users/shareItem/MTY1

I want to create deep linking so I am using following code. 我想创建深层链接,因此我正在使用以下代码。 If the app is not installed it should redirect to Google Play store otherwise it will open the app. 如果未安装该应用,则应将其重定向到Google Play商店,否则它将打开该应用。 However opening this browser does nothing. 但是,打开此浏览器没有任何作用。

On app side i am using this code 在应用程序方面,我正在使用此代码

<activity
            android:name=".activities.SplashActivity"
            android:screenOrientation="portrait">

            <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"></action>

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

                <data
                    android:host="domain.be"
                    android:scheme="http"
                    android:path="/app_name/users/shareItem"
                    >
                </data>
            </intent-filter>

        </activity>

On server side I am doing this 在服务器端,我正在这样做

  $this->redirect("intent://domain.be/app_name/users/shareItem/#Intent;scheme=http;package=com.domain.app_name;end");

I have chrome only on simulator and when i run the above Url , it does nothing. 我只在模拟器上安装了chrome,当我运行上述网址时,它什么也没做。

If you want to open Play Store if app is not installed then you should use deep linking by Branch.Io 如果您要在未安装应用的情况下打开Play商店,则应使用Branch.Io的深层链接

It is very good in deep linking and easy to use. 它在深度链接方面非常好并且易​​于使用。

I have used deep linking by Intent but it is not redirecting me to the play store if app not installed. 我使用了Intent的深层链接,但如果未安装应用程序,则不会将我重定向到Play商店。

Try this hope it helps you. 尝试此希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM