如何显示“分享” Spotify 应用程序中的弹出窗口?

发布于 2024-12-25 19:39:00 字数 61 浏览 2 评论 0原文

开发 Spotify 应用程序时,如何显示标准 Spotify“共享”弹出窗口,以便为所选歌曲做正确的事情?

When developing a spotify app, how do I show a standard spotify "share" popover that will do the right thing for a song of choice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鱼窥荷 2025-01-01 19:39:00

目前,还没有可用的公共 API。我们将很快发布包含它的更新版本。

在此之前,您可以使用以下私有 API。请注意,如果您希望在 App Finder 中发布您的应用程序,则必须在发布后移至公共 API:

sp.social.showSharePopup(x, y, uri);

... 其中 x 和 y 是应用程序内要显示弹出窗口的坐标。

At the moment, there's no public API for this. We'll be releasing an updated build soon that includes it.

Until then, you can use the following private API. Please note that you must move over the the public API once released if you want your application to be published in the App Finder:

sp.social.showSharePopup(x, y, uri);

... where x and y are the coordinates inside your app where the popup is to be shown.

2025-01-01 19:39:00

请注意,如果您想在 anchorElement 上使用 jQuery 选择器,我会这样做:

$(target).on('click', function() {
    models.application.showSharePopup($(this).get(0), spotify:track:6JEK0CvvjDjjMUBFoXShNZ);
}); 

Note that if you want to use a jQuery selector on anchorElement I did like this:

$(target).on('click', function() {
    models.application.showSharePopup($(this).get(0), spotify:track:6JEK0CvvjDjjMUBFoXShNZ);
}); 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文