簡體   English   中英

有什么方法可以知道Android App Link是否會打開一個應用程序嗎?

[英]Is there any way to know whether an Android App Link will open an app or not?

是否可以通過編程方式知道HTTPS URL是否將使用Android App Links打開Android應用程序

對於通用鏈接(相當於應用程序鏈接的iOS),當進行鏈接以確保URL是否打開某個應用程序時,它可以使用static let universalLinksOnly: UIApplication.OpenExternalURLOptionsKey在此處記錄 )。 是否有與此相對應的Android應用鏈接?

<activity
    android:name=".ui.activity.TestActivity"
    android:label="@string/app_name"
    android:launchMode="singleTask"
    android:screenOrientation="portrait">
    <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="testapp"
            android:host="host1"
            android:path="/path1"
            android:port="8080" />
    </intent-filter>
</activity>

然后:

<a href="testapp://host1:8080/path1?query1=1&query2=true">Open from App</a>

其中,方案和主機是必需的,其他要求取決於您的實際需求。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM