gpt4 book ai didi

swift - SSAccountStore : Unable to get the local account. 错误 = 错误域 = SSErrorDomain 代码 = 100

转载 作者:行者123 更新时间:2023-12-02 09:35:32 24 4
gpt4 key购买 nike

我在访问用户 Apple Music 时遇到问题。我收到的错误是

 [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2019-02-04 19:14:37.250467+0900 SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
2019-02-04 19:14:37.252008+0900 [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2019-02-04 19:14:37.252051+0900 SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
2019-02-04 19:14:37.253604+0900 SSAccountStore: Unable to get the local account. error = Error Domain=SSErrorDomain Code=100 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}

但是这段代码的奇怪部分是我还能够检索音乐用户 token 。我缺少什么吗?如有任何帮助,我们将不胜感激。

    static func auth(){
let cloudServiceController = SKCloudServiceController()

let developerToken = "abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxyz"


SKCloudServiceController.requestAuthorization { status in
guard status == .authorized else { return }
}

cloudServiceController.requestCapabilities { capabilities, error in
guard capabilities.contains(.musicCatalogPlayback) else { return }
}

cloudServiceController.requestUserToken(forDeveloperToken: developerToken, completionHandler: { token, error in

guard let token = token else { return }
UserDefaults.standard.set(token, forKey: "MUSIC_USER_TOKEN")
UserDefaults.standard.set(developerToken, forKey: "DEVELOPER_TOKEN")
print("Music User Token:", token)
})
}

最佳答案

我想你必须打电话cloudServiceController.requestUserToken一旦用户在 SKCloudServiceController.requestAuthorization

的完成处理程序后获得授权

关于swift - SSAccountStore : Unable to get the local account. 错误 = 错误域 = SSErrorDomain 代码 = 100,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54514183/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com