使用以下代码检查用户的库是否包含特定歌曲。它返回一个错误。我能做错什么?我无法找到这个特殊的例子,因为我们已经找到了解决问题的方法。方法无处不在。
let accessToken = SPTAuth.defaultInstance().sessionUserDefaultsKey
let request: URLRequest = try!
SPTYourMusic.createRequest(forCheckingIfSavedTracksContains: ["spotify:track:3ZakaL0QEt5eeD3N7HbaN1"], forUserWithAccessToken: accessToken)
SPTRequest.sharedHandler().perform(request) { (error, response, data) in
if error == nil {
print ("this is data\(String(describing: data))")
} else {
print ("error")
}
}
错误是:
错误域= NSURLErrorDomain代码= -1012"(null)" UserInfo = {NSErrorFailingURLStringKey = api.spotify.com / v1 / me / tracks / contains?ids =,NSUnderlyingError = 0x109e7eb60 {Error Domain = kCFErrorDomainCFNetwork Code = -1012"(null)" UserInfo = {_ kCFURLErrorAuthFailedResponseKey =< CFURLResponse 0x109e7e970 [0x1b441e538]> {url = api.spotify.com/v1/me/tracks/contains?ids=}}},NSErrorFailingURLKey = api.spotify.com / v1 / me / tracks /包含?IDS =}