【发布时间】:2019-07-01 01:50:36
【问题描述】:
我正在尝试使用以下 Swift 函数禁用后台 Spotify 自动播放(通过 App Remote SDK)。
private static func configureAppRemote() {
if let player_api = SpotifySDK.shared.app_remote.playerAPI {
player_api.setRepeatMode(.off, callback: SpotifySDK.debug_callback)
player_api.setShuffle(false, callback: SpotifySDK.debug_callback)
is_configured = true
} else {
is_configured = false
}
}
我的 SpotifySDK.debug_callback 打印出这两个调用的闭包参数并返回 (result, error) = (nil, nil),尽管 Objective-C Spotify SDK 源代码声称这种状态是不可能的:
@param callback On success `result` will be `YES`.
On error `result` will be `nil` and `error` will be set.
有人知道如何使用 App Remote 正确禁用自动播放吗?
【问题讨论】: