0
我有一個網站和親戚的iOS和Android應用程序。Javascript - 應用程序內容的深層鏈接
當用戶從移動設備點擊我在fb或twitter上共享的內容時,它會重定向到網站。然後,我實現了一個腳本,以查明設備是否安裝了應用程序,否則打開市場(谷歌播放或iOS應用程序商店)。
的腳本是:
deepLink: function (contentId, store) {
if (contentId && contentId != '')
window.location.href = "my_app://" + contentId;
else
window.location.href = "my_app://";
$timeout(function() { window.location.href = store; }, 25);
}
其中「內容識別」是詳細信息頁面的ID和「存儲」是Android或iOS市場的URL。
這不起作用,因爲它打開了應用程序,但也打開了市場。 我想只打開應用程序或只有市場,如果應用程序沒有安裝。 有沒有解決方案?我已經讀過,它總是建議重定向到應用程序商店,而不是直接到應用程序,但客戶特意問我這個功能。
AndroidManifest.xml中
<activity>
<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="hotstar" />
</intent-filter>
</activity>
有人能幫助我嗎? thx
爲了實現你想要的,你確實在你的'AndroidManifest.xml'中實現了一些'intent-filters'?請發佈您的'AndroidManifest.xml'文件(相關部分)。 – shkschneider
我更新了你的問題。下次,請編輯您的問題。評論中的這一數量的XML毫無意義。 – shkschneider