如何在 Spotify 应用程序中实际设置 DefaultTabs?

发布于 2024-12-29 00:35:16 字数 873 浏览 2 评论 0原文

Spotify Apps API 的集成指南提到了 DefaultTabs 以及它应该如何使用在 manifest.json 文件中表达,以在 Spotify 应用程序中实现 Tab 键切换。不幸的是,我在让它工作时遇到问题,并且它引用的应用程序(选项卡,带有 URI spotify:app:tabs)例如在我的 Spotify 应用程序预览版本中不存在。

应用程序可以在 DefaultTabs 属性中指定清单文件中需要哪些选项卡。该属性必须是记录列表。每条记录必须包含属性argumentstitle。标题可以而且应该通过将其放入具有每种语言属性的记录(当前为 enfres)来本地化。

我已尝试以下操作:

  1. 将此代码段添加到我的 manifest.json 文件中:

    “默认选项卡”:[{
      参数:[],
      title: {"en": "På TV4"}
    }
    ]
    
  2. 退出 Spotify 应用程序并重新加载它。

  3. 通过在地址字段中输入其地址 spotify:app:name 来加载我的应用。

在这里,我希望看到选项卡已加载,但事实并非如此。任何有关正确语法的帮助将不胜感激。

The integration guidlines for the Spotify Apps API mentions DefaultTabs and how it should be expressed in the manifest.json file to achieve tabbing in your Spotify app. Unfortunately I have problem getting this to work and the app that it refers to (Tabs, with the URI spotify:app:tabs) for example doesn't exist in my preview build of the Spotify application.

The application can specify what tabs it wants in the manifest file, in the DefaultTabs attribute. The attribute must be a list of records. Each record must contain the attributes arguments and title. The title can, and should, be localized by making it into a record with attributes for each language (currently en, fr and es).

I have tried the following:

  1. Adding this snippet to my manifest.json file:

    "DefaultTabs": [{
      arguments: [],
      title: {"en": "På TV4"}
    }
    ]
    
  2. Quitting the Spotify application and reloading it.

  3. Load my app by entering it's address spotify:app:name in the address field.

Here I expected to see the tabs loaded, but it wasn't. Any help with the correct syntax would be appreciated.

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

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

发布评论

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

评论(1

命硬 2025-01-05 00:35:16

一开始我也遇到了一些问题,但以下代码片段对我有用:

"DefaultTabs": [
    {
        "arguments": "test",
        "title":  { "en": "test" }
    },
    {
        "arguments": "test2",
        "title": { "en": "test2" }
    }
]

我认为您可能错过了论点。

另请查看 GitHub 中的 Kitchensink 演示应用程序和源代码:https://github.com/ptrwtts/kitchensink

I had a few issues at first too, but the following snippet works for me:

"DefaultTabs": [
    {
        "arguments": "test",
        "title":  { "en": "test" }
    },
    {
        "arguments": "test2",
        "title": { "en": "test2" }
    }
]

I think you are probably missing the arguments.

Also check out the Kitchensink demo app and sourcecode in GitHub: https://github.com/ptrwtts/kitchensink

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文