However I implement the proper MPRemoteCommandCenter functions, the playback buttons are not responsive at all in carplay app.
(It works correctly with CarPlay before iOS 14, using MPPlayableContentManager)
Non of the MPRemoteCommandCenter callbacks are being called.
What could be the reason?
The code where I set up remote command center:
func setupRemoteCommandCenterTargets() {
let commandCenter = MPRemoteCommandCenter.shared()
commandCenter.playCommand.isEnabled = true
commandCenter.playCommand.addTarget {event in
//myPlayer.play()
return .success
}
commandCenter.pauseCommand.isEnabled = true
commandCenter.pauseCommand.addTarget {event in
//myPlayer.pause()
return .success
}
commandCenter.nextTrackCommand.isEnabled = true
commandCenter.nextTrackCommand.addTarget {event in
//myPlayer.next()
return .success
}
commandCenter.previousTrackCommand.isEnabled = true
commandCenter.previousTrackCommand.addTarget {event in
//myPlayer.prev()
return .success
}
}