如何在 Spotify 应用程序中实际设置 DefaultTabs?
Spotify Apps API 的集成指南提到了 DefaultTabs 以及它应该如何使用在 manifest.json
文件中表达,以在 Spotify 应用程序中实现 Tab 键切换。不幸的是,我在让它工作时遇到问题,并且它引用的应用程序(选项卡,带有 URI spotify:app:tabs
)例如在我的 Spotify 应用程序预览版本中不存在。
应用程序可以在
DefaultTabs
属性中指定清单文件中需要哪些选项卡。该属性必须是记录列表。每条记录必须包含属性arguments
和title
。标题可以而且应该通过将其放入具有每种语言属性的记录(当前为en
、fr
和es
)来本地化。
我已尝试以下操作:
将此代码段添加到我的
manifest.json
文件中:“默认选项卡”:[{ 参数:[], title: {"en": "På TV4"} } ]
退出 Spotify 应用程序并重新加载它。
通过在地址字段中输入其地址
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 attributesarguments
andtitle
. The title can, and should, be localized by making it into a record with attributes for each language (currentlyen
,fr
andes
).
I have tried the following:
Adding this snippet to my
manifest.json
file:"DefaultTabs": [{ arguments: [], title: {"en": "På TV4"} } ]
Quitting the Spotify application and reloading it.
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一开始我也遇到了一些问题,但以下代码片段对我有用:
我认为您可能错过了论点。
另请查看 GitHub 中的 Kitchensink 演示应用程序和源代码:https://github.com/ptrwtts/kitchensink
I had a few issues at first too, but the following snippet works for me:
I think you are probably missing the arguments.
Also check out the Kitchensink demo app and sourcecode in GitHub: https://github.com/ptrwtts/kitchensink