4

I'm working on an iOS app that is supposed to track the distance I'm driving in my car. My idea is to start tracking when the device connects to my Bluetooth Audio System.

However,

  1. the audio system does not seem to broadcast any BLE stuff, so CBCentralManager seems to not work for me.
  2. I don't get any EAAccessoryDidConnect Notifications, not even if the app is active
  3. I do get AVAudioSessionRouteChange Notifications when a AVAudioSessionPortBluetoothA2DP connects, BUT only when the app is active. If not, Notifications are queued and received when I manually open up the app

Does anyone have any further idea how fix my problem?

Thanks in advance, Stefan

Stefan
  • 295
  • 3
  • 18
  • I have the same issue, did you found any solution? thx! – dejix May 21 '18 at 13:23
  • @dejix did you find any solution? – Keselme May 18 '21 at 06:57
  • Since you're tracking distance, you can use the `locationManager` to wake up your app on [significant location changes](https://developer.apple.com/documentation/corelocation/cllocationmanager/1423531-startmonitoringsignificantlocati). This would then receive your `AVAudioSessionRouteChange` in the background, and you can start listening for location updates, which would keep your app alive. Note that you require always permission on your locationManager. – Sander Saelmans Sep 03 '21 at 06:05

0 Answers0