【问题标题】:How to open my android app from clicking custom URL?如何通过单击自定义 URL 打开我的 android 应用程序?
【发布时间】:2016-12-16 06:57:00
【问题描述】:
【问题讨论】:
标签:
android
facebook
bots
deep-linking
facebook-messenger
【解决方案1】:
@Suhas Bachewar,
要从其他应用打开您的应用,您必须实现
deep-link
请查找tutorial from here。
以下 XML sn-p 显示了如何实现深度链接,您可能必须在清单中指定意图过滤器以进行深度链接。
URI“yourapp://droid”和“http://www.yourapp.com/droid”都解析到这个活动。
接受以“http://www.yourapp.com/droid”开头的 URI
<activity
android:name="com.yourapp.activity"
android:label="@string/title" >
<intent-filter android:label="@string/filter_title">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="www.yourapp.com"
android:pathPrefix="/droid" />
<!-- note that the leading "/" is required for pathPrefix-->
<!-- Accepts URIs that begin with "yourapp://droid” -->
<data android:scheme="yourapp"
android:host="droid" />
</intent-filter>
</activity>