I'm doing my app that need to know if iphone connected to carplay, and do somthing before that.
I've seached everywhere and found some method, but seems every method got problem.
if your app is music type and using key "com.apple.developer.playable-content"
you can get notify when connect/disconnect from "MPPlayableContentDelegate ->playableContentManager ->context.endpointAvailable"
But my concern:
A. my app is voip type using key "com.apple.developer.carplay-calling", if I using MPPlayableContentDelegate, seems not properly.
B. does MPPlayableContentDelegate on used in carplay? Does any other device connected to iphone will receive this notify?
check the "AVAudioSession.sharedInstance().currentRoute.outputs.first" when receive method1 notify.
But only can get right value when audio file is playing. if no audio playing, it always get the iphone self instead of carplay.
using "EAAccessoryManager.shared().connectedAccessories", it needs manually set the info.plist supported protocal in advance.
so if I cant set the right protocal for every car type, I cant get the accessories.
Anyone can help on this issue, thanks.