Spotify cocoalibspotify offline status set to 1 bu

2019-06-01 09:57发布

问题:

I'm trying to allow tracks from Spotify to be played offline in my iOS app. I've read several posts about this problem, but none of the suggestions work for me.

The issue is a playlist marked for download gets stuck with all tracks "waiting" to be downloaded. I can recreate it regularly in a fresh app install by creating a playlist, adding a few tracks, and mark playlist for download. Tracks download as expected. Then I background the app by tapping the home button and kill the app in the app tray. Then I start the app and successfully login with – attemptLoginWithUserName:existingCredential: I create another playlist, add some more tracks and mark for offline. The new playlist's offline status shows downloaded, but all the tracks are waiting.

I've tried:

1) flushCaches: after playlists are downloaded

2) flushCaches: in applicationDidEnterBackground

3) logout in applicationDidEnterBackground:

4) logout in applicationWillTerminate:

5) setting badly behaving playlist markedforofflineplayback to off, flush caches and set markedforofflineplayback to off again.

So far, once a playlist has gotten stuck, the only way to get another playlist downloaded has been to delete the app and reinstall.

Does anyone have other suggestions for how to solve this problem?

回答1:

This is a known issue that an update will fix soon. In the meantime, if a playlist gets stuck you can delete the cache folder that CocoaLibSpotify creates which is one step short of reinstalling, but not exactly a useful workaround.