spotify / ios-sdk

Spotify SDK for iOS
https://developer.spotify.com/documentation/ios/
658 stars 185 forks source link

Offline playback support - playing downloaded songs without internet connection (or poor) #74

Open eanntuan opened 5 years ago

eanntuan commented 5 years ago

Is it possible to continue playing songs downloaded from the Spotify app, using the new SDK, after losing internet connection (aka offline playback support)?

Example scenario:

  1. User logs into app, authenticates with previously installed Spotify app on their phone
  2. User selects a playlist with pre-downloaded songs on their phone .
  3. User loses connection (either with airplane mode or using the Network Link Conditioner to simulate a poor connection
  4. User continues to stream downloaded songs from Spotify
arirawr commented 5 years ago

Hi @eanntuan, yes this SDK supports offline playback for songs the user has offlined in the Spotify app :)

surani444 commented 5 years ago

Hi, @eanntuan which iOS SDK version support offline playback?

eanntuan commented 5 years ago

Hi @surani444 I'm noticing that we're actually having trouble connecting to the Spotify iOS SDK for offline playback support.

For example, I was in the airplane on Airplane mode and no wifi connection, but I'm able to play my downloaded playlist through the Spotify app. However, when I try to connect to Spotify in my own app using appRemote.authorizeAndPlayURI(uri ?? ""), I'm not able to connect.

So looks like you are able to play downloaded music with no internet connection, but to play those same songs from an external app using the iOS sdk, you cannot. Am I correct in that assumption? @arirawr

Thanks so much!

dataexcess commented 5 years ago

Hello @surani444,

I have the same questions as @eanntuan:

Is it possible to fetch and play downloaded library songs remotely while being offline? When I play around with the demo app 'NowPlayingView', It seems that to get the app running an initial remote connection is necessary and WiFi (not even mobile data) is required for this. Is this correct? If this is the case then I'm a bit lost at what you mean with 'offline support' which is a new feature of this SDK. Could you provide a working demo to preview this feature?

Ideally we would like to cache in our app every song that has offline support and being able to play them offline.

Thank you!

kkarayannis commented 5 years ago

Hi @dataexcess yes you are correct that the current SDK only allows you to play offlined tracks only after you have authenticated. However a true offline mode is planned to be released soon, where an app can authenticate and play with no network at all, provided it had authenticated online in the past.

dataexcess commented 5 years ago

@kkarayannis Ok, thank you for the clarification on this!

pedro commented 5 years ago

@kkarayannis thanks for the update! Is there any ETA for a release with offline auth? Any issue I can follow to be notified when it's out? 😬

kkarayannis commented 5 years ago

@pedro I will post an update here once it’s available.

kkarayannis commented 4 years ago

The new update with support for offline is now released.