Check if Spotify playlists and tracks failed to load

50 views Asked by At

How can I detect if spotify has failed to load. If the device does not have internet connection, I understand that SPAsyncLoad can still get the tracks that were cached. But is there a way to detect a failure of loading in SPAsyncLoad if there is no internet connection or if it cannot get track due to some error?

1

There are 1 answers

0
iKenndac On

SPAsyncLoading's callback contains two parameters. The first one is an array of items that did load, and the second one items that didn't.

[SPAsyncLoading waitUntilLoaded:items timeout:kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedItems, NSArray *notLoadedItems) {

    if (notLoadedItems.count > 0) {
        NSLog(@"Some items failed to load!");
    }
}];