按 link android 启动另一个应用

Start another app by link android

如何通过link在B应用中启动A应用的特定activity?

  1. 共享 URI 包含有关 A 的特定信息 activity。
  2. 如果用户在 B 应用程序中单击 link,则启动 A 应用程序的特定 activity。

这是我的 AndroidManifiest.xml 代码。

 <activity android:name = ".activity.PhotoActivity">
        <intent-filter >
            <data android:scheme="mine" android:host="photo"/>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
        </intent-filter>
 </activity>

这是shareURI方法。

 fun sendUri(videoId:String?, point:Long) {
    val sharedUri = "mine://photo?photo_id=$photoId&size=$size"

    val intent = Intent(Intent.ACTION_SEND)
    intent.type = "text/plain"
    intent.addCategory(Intent.CATEGORY_DEFAULT)
    intent.addCategory(Intent.CATEGORY_BROWSABLE)
    intent.data = Uri.parse(sharedUri)
    startActivity(Intent.createChooser(intent, "Share URL"))

}

但它不起作用。 当我尝试分享 link 时,选择器没有出现。 并且有一条消息。

'All app associated with this action have been disabled, blocked, or are not installed.`

我使用 firebase DynamicLink。 很有用。