简体   繁体   English

如何通过SoundCloud上的Javascript SDK获取access_token?

[英]How to get access_token via Javascript SDK on SoundCloud?

I'm using the Javascript SDK to access the SoundCloud API and I can't figure out how to maintain the connection using the javascript API.. every time I refresh, it makes you re-connect again, which is crummy for UX. 我正在使用Javascript SDK访问SoundCloud API,我无法弄清楚如何使用javascript API维护连接..每次刷新时,它都会让你再次重新连接,这对于UX来说很糟糕。

How can get the access_token so that I can store, and then subsequently, how do I re-send that token to authorize so the user doesn't need to reconnect each time they visit the page. 如何获取access_token以便我可以存储,然后如何重新发送该令牌以进行授权,这样用户每次访问页面时都不需要重新连接。

There's a ton of docs about how to do it with PHP, etc...but nothing in Javascript SDK about access tokens. 有很多关于如何用PHP等做的文档...但Javascript SDK中没有关于访问令牌的内容。

I am pretty sure that the SC.isConnected() function was working, but now it just loads the connect button each time. 我很确定SC.isConnected()函数是否正常工作,但现在它只是每次加载连接按钮。

Everything is working correctly, I just don't want the user to have to reconnect each time. 一切正常,我只是不希望用户每次都必须重新连接。

You can use SC.accessToken() to access it. 您可以使用SC.accessToken()来访问它。 We are planning to provide some sort of session persistence and a better backend integration in the next 2 months. 我们计划在未来2个月内提供某种会话持久性和更好的后端集成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM