0

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?

SleepNot
  • 2,982
  • 10
  • 43
  • 72

1 Answers1

0

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!");
    }
}];
iKenndac
  • 18,730
  • 3
  • 35
  • 51