Question

So far i have done this. But it is return nil in sptrack.

 NSURL *trackURL = [NSURL URLWithString:msg];
                // spotify:track:489K1qunRVBm2OpS4XGLNd
            [[SPSession sharedSession] trackForURL:trackURL callback:^(SPTrack *track)
             {
                self.currentTrack = track;
                NSLog(@"SPTrack : %@",self.currentTrack);
                if (track != nil)
                {

                    [SPAsyncLoading waitUntilLoaded:track timeout:kSPAsyncLoadingDefaultTimeout then:^(NSArray *tracks, NSArray *notLoadedTracks) {
                        self.currentTrack = track;
                        NSLog(@"SPTrack : %@",self.currentTrack);
                    }];
                }
            }];
Was it helpful?

Solution

Your code looks fine, so double check that:

1) The URL is correct.

2) That CocoaLibSpotify is logged in with a valid user. Practically nothing works unless you're logged in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top