[英]Android deep linking not redirecting to play store
我已自定義深層鏈接,對於擁有該應用程序的用戶來說,它工作正常。 但是對於沒有該應用程序的用戶,它不會將其重定向到Playstore。
<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:host="abc.in"
android:pathPrefix="/abc"
android:scheme="http" />
<action android:name="android.intent.action.VIEW" />
</intent-filter>
MY代碼生成深層鏈接
public void Share() {
firebaseAnalyticsUtil.fireEvent("shared_link");
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(Intent.EXTRA_SUBJECT,"Hey!");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Share Text - "+"http://abc.in/abc/"+ID);
startActivity(Intent.createChooser(sharingIntent,"Share using"));
}
如果用戶沒有應用,請協助我將用戶重定向到Playstore
您正在使用App Links ,這意味着它們是常規的http://
鏈接。 當用戶單擊http://abc.in/abc
,將發生以下兩種情況之一:
http://abc.in/abc
。 在您要處理的情況2中,此方法很簡單:使用位於http://abc.in/abc
的頁面將訪客重定向到Play商店。 這可以通過Javascript或HTTP(最常見的是307重定向)來完成。
但是,請注意,僅此一項不足以提供完整的深度鏈接解決方案。 您還需要支持...
我建議研究托管的深層鏈接服務,例如Branch.io (完整披露:我在Branch團隊中)或Firebase動態鏈接。 它們將使您的生活更加輕松。
為了使其對沒有您的應用的用戶有效,您可以使用Firebase動態鏈接。 您還可以使用Firebase動態鏈接跟蹤參數和分析。 它是免費使用。 這是其教程的鏈接。 它很容易遵循教程。
https://firebase.google.com/docs/dynamic-links/
如果您在實現動態鏈接時遇到任何麻煩,請隨時與我聯系。
要在PlayStore上進行重定向,請在下面的行中使用;
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("use your playstore app Link")));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.