removeTracksFromPlaylist不使用ios spotify sdk删除曲目
我正在测试这个方法,以便从播放列表中删除曲目。基本上,我修改了SDK附带的演示项目“simple track Replay”。当你点击快进时,我想删除播放列表中的曲目。我以这种方式更改了快进方法,但它什么也没做,错误为零removeTracksFromPlaylist不使用ios spotify sdk删除曲目,ios,objective-c,spotify,playlist,Ios,Objective C,Spotify,Playlist,我正在测试这个方法,以便从播放列表中删除曲目。基本上,我修改了SDK附带的演示项目“simple track Replay”。当你点击快进时,我想删除播放列表中的曲目。我以这种方式更改了快进方法,但它什么也没做,错误为零 -(IBAction)fastForward:(id)sender { if([self.player isPlaying] && self.currentPlaylistSnapshot){ SPTAuth *auth = [SPTAu
-(IBAction)fastForward:(id)sender {
if([self.player isPlaying] && self.currentPlaylistSnapshot){
SPTAuth *auth = [SPTAuth defaultInstance];
[self.currentPlaylistSnapshot removeTracksFromPlaylist:@[self.player.currentTrackURI]
withAccessToken:auth.session.accessToken
callback:^(NSError *error) {
if (error != nil) {
NSLog(@"*** Failed to remove track : %@", self.titleLabel.text);
return;
}
}];
}
[self.player skipNext:nil];
}
self.CurrentPlaySnapshot
是我从handleNewSession
方法得到的快照
还有一个静态方法显然提供了类似的东西,我还没有尝试过
createRequestForRemovingTracks:fromPlaylist:withAccessToken:snapshot:error:
根据文档,这两个选项都是异步实现的,需要几秒钟才能在服务器中反映结果,但我怀疑可能是出了问题,或者我只是错过了在本地快照上推送更改的实际请求
文件:
:
ios sdk:
我通过重置模拟器+添加sptauthPlayModifyPublicScope解决了我的问题(我不想这么做…)
auth.requestedScopes = @[SPTAuthStreamingScope, SPTAuthPlaylistModifyPublicScope];