Peter-Schorn / SpotifyAPI

A Swift library for the Spotify web API. Supports all endpoints.
https://peter-schorn.github.io/SpotifyAPI/documentation/spotifywebapi
MIT License
251 stars 32 forks source link

iPhone not showing in available devices #30

Closed kimfucious closed 2 years ago

kimfucious commented 2 years ago

Hi @Peter-Schorn, I'm really starting to love this library you've created. Thanks for making it!

I somewhat confused by the results of availableDevices().

In brief, I can see the computer where I've installed the Spotify app, but I can't see the iPhone, where I've installed the Spotify app.

I have read this: https://github.com/Peter-Schorn/SpotifyAPI/wiki/Using-the-Player-Endpoints

And the output from this library is the same as here: https://developer.spotify.com/console/get-users-available-devices/.

This leads me to believe that this library is working perfectly and there's something that I'm not doing that would allow the iPhone to show up as an available device.

While I know that this issue his not related to this library, I was wondering if you've come across this before, and how it might be resolved.

I thought maybe the test account that I'm using might need to be a premium account, but the MacOS app seems to work just fine, so I'm leaning toward that not being the issue.

I've also tried various things like logging out, deleting the Spotify app from the phone, re-installing, and logging back in as the same user, but that doesn't seem to change anything.

Thanks in advance for any insight that you may have and thanks again for this awesome library!

Peter-Schorn commented 2 years ago

The Spotify iOS app must be open and in the foreground for it to show up as an available device—unless it is currently playing music, in which case it will show up as the active device even if the app is running in the background.

When you play content from the Spotify desktop app, does it show up on the iOS app? For example: IMG_AA1754982419-1

If not, then you may need a premium account.

kimfucious commented 2 years ago

Hi @Peter-Schorn,

Thanks for your responsiveness to what I know is not an issue with your incredibly useful library.

Here's what I can say, at the moment, as I work through this with your valued and very much appreciated assistance:

If a song is playing in the Spotify desktop app, and I open the Spotify app on my iPhone, I get a message on the iPhone that reads something like:

"You are listening on "

It presents two buttons:

One says, "Continue" If this is tapped, then nothing really happens in the user's perspective and things keep playing on the desktop app.

Another second button says, "Listen on this iPhone" If this is tapped, the song transfers to the iPhone app, "automagically" and continues playing on the iPhone.

Further after the second button has been tapped, I can tap another button (in the Spotify iOS app) which allows me to select desktop machine and play the track on the desktop computer. The track continues right where it left off on the iPhone, which is pretty cool.

All that said, there's no point in time where my app, using .availableDevices() shows the expected iPhone as a device in the return.

In sum, the iPhone Spotify app seems to be well aware of the desktop Spotify app's state, but not the other way around.

I'm still researching this and will try with a premium account, posting any findings here, if they may be helpful to others who may come across this thread.

kimfucious commented 2 years ago

Update:

I just noticed that in the macOS app, that there are devices in the bottom right hand corner, and my iPhone is one of them (the other is my PS4).

Both are listed as "Unavailable to control", which makes me think this requires Spotify Connect, which is a premium service.

image

kimfucious commented 2 years ago

Okay, tested with a premium account, and that has definitely made a difference toward the positive with regard to recognizing the iPhone as an available device.

Next step: playing stuff.