Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUESTION: After session/token from Spotify expires, does requesting a new session/token always opens and switches to the Spotify App? #229

Open
bumpingChris opened this issue Jan 29, 2023 · 2 comments

Comments

@bumpingChris
Copy link

bumpingChris commented Jan 29, 2023

I would like to be able to request a new session/token from Spotify without switching to the Spotify app.
This might be related to:
#42 (comment)

Here are what I'm confused about:

  1. Is there a way to prevent having to always open the Spotify App? Is that what the refresh-token is for?
  2. If refresh-token / renew session is the way, it seems we have to implement/call the refresh token mechanism ourselves atm - it is not part of the example.
  3. How long a life does the refresh-token have before it expires as well?
@cjam
Copy link
Owner

cjam commented Jan 30, 2023

Hey good question. I haven't had a chance to get the refresh tokens figured out. Ideally this library could transparently refresh them and maintain the connection. I have found the iOS implementation from spotify to be challenging due to iOS backgrounding spotify after inactivity. So then the only way to wake it up is through the auth flow. That being said, if it's still awake in the background, I'm sure you could try and use the web sdk to refresh the token and then try to use this library to re-establish the connection with the new token.

Again, I haven't tried it, but that's the approach I would try first. The tokens should come back with expiry dates, but I don't recall if I was exposing all of that through this library.

@bumpingChris
Copy link
Author

Hey good question. I haven't had a chance to get the refresh tokens figured out. Ideally this library could transparently refresh them and maintain the connection. I have found the iOS implementation from spotify to be challenging due to iOS backgrounding spotify after inactivity. So then the only way to wake it up is through the auth flow. That being said, if it's still awake in the background, I'm sure you could try and use the web sdk to refresh the token and then try to use this library to re-establish the connection with the new token.

Again, I haven't tried it, but that's the approach I would try first. The tokens should come back with expiry dates, but I don't recall if I was exposing all of that through this library.

@cjam Thank you for your response and your effort on this. Really appreciate it. I'll play around with trying to get the refresh to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants