例如,
deepLink
等于spotify:app:com.example.name:playlist:37i9dQZEVXbdGwWzuKJrad
,就像这里的旧示例一样。它只是打开 Spotify,没有目标播放列表。我们可以将源应用程序附加到 spotify:playlist:37i9dQZEVXbdGwWzuKJrad
吗?
如果出现
branchLink
浏览器打开。
val deepLink = "spotify:app:${context.packageName}:${entityType.argument}:${model.itemId}"
val spotifyContent = "https://open.spotify.com/playlist/${model.itemId}"
val branchLink = "https://spotify.link/content_linking?~campaign=${context.packageName}&\$deeplink_path=$spotifyContent&\$fallback_url=" + spotifyContent
val nativeIntent = Intent(Intent.ACTION_VIEW, Uri.parse(deepLink))
val webIntent = Intent(Intent.ACTION_VIEW, Uri.parse(branchLink))
引用的答案很旧。也许10年前还可以,但是这种格式的URI
spotify:app:com.example.name:playlist:37i9dQZEVXbdGwWzuKJrad
现在肯定不行了。