Sah*_*kar 0 android deep-linking applinks deeplink
I have implemented deeplinking in one for my activities. But when the link is clicked, an Intent chooser opens asking whether to open from the app or from the browser. How to open from app directly?
Also, when the app is not installed, it does not take to playstore. It opens in the browser.
Below is my code in the manifest :
<activity android:name=".activities.VideoNewsDetailActivity"
android:theme="@style/AppThemeActivity"
android:configChanges="orientation|screenSize"
>
<!-- Add this new section to your Activity -->
<intent-filter android:label="@string/videoNewsDetail">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Handle urls starting with "http://www.example.com/products" -->
<data android:scheme="http"
android:host="ddnews.apprikart.in"
android:pathPrefix="/videos" />
<!-- Handle local urls starting with "example://products" -->
<data android:scheme="ddnews.apprikart"
android:host="videos" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
这就是意图过滤器的工作方式。如果超过 1 个应用程序可以处理您的意图,它将显示一个意图选择器。是否要在您的应用程序或浏览器中打开链接取决于用户。
您的服务器应该处理 Playstore 重定向部分。例如,您的深层链接网址是http://www.example.com/page/1。现在,当未安装应用程序时,服务器可以检查 url 是否是从浏览器调用的,然后它应该将浏览器重定向到 Playstore 的应用程序 url。
归档时间: |
|
查看次数: |
1197 次 |
最近记录: |