Search code examples
iosobjective-cairpods

Getting automatic detection information from Airpods pro/max


Is it possible to get the information of automatic detection (when ear/head-phones are put/removed)?

If so, how can it be done?


Solution

  • Observe the notification AVAudioSession.routeChangeNotification. For full details (including how to properly respond to this notification), see Responding to Audio Session Route Changes.