You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Flutter中使用external_app_launcher包打开Spotify深度链接

实现跳转Spotify指定深度链接页面的方法

你当前代码仅能打开首页的原因是没有传入目标深度链接参数,按照以下方式修改即可:

1. 完整调用代码

// 你的目标Spotify页面路径
final targetPlaylistPath = 'playlist/37i9dQZF1DWX5ZOsG2Ogi1?si=41c6a392cf7d4a2b';

await LaunchApp.openApp(
  androidPackageName: 'com.spotify.music',
  // iOS端拼接Spotify scheme和目标路径
  iosUrlScheme: 'spotify://$targetPlaylistPath',
  // Android端传入完整https格式的深度链接即可
  deeplink: 'https://open.spotify.com/$targetPlaylistPath',
  // 可选配置:用户未安装Spotify时是否跳转应用商店,不需要可设为false
  openStore: true,
);

2. iOS端额外前置配置

需要在项目ios/Runner/Info.plist文件中添加如下配置,否则iOS系统会禁止拉起Spotify应用:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>spotify</string>
</array>

注意事项

  • 如果需要跳转其他类型的Spotify页面,只需要替换targetPlaylistPath的内容即可,比如艺人页路径为artist/xxx、专辑页路径为album/xxx
  • Android端可以直接传入https格式的Spotify公开链接,系统会自动唤醒Spotify应用加载对应页面

内容的提问来源于stack exchange,提问作者Rabbiot Rabbiot

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.27 08:15:01