2

I'm trying to know how is possible to observe events from Bluetooth handsfree(Particular case - Plantronics M50) devices? WatsApp does it, through the BTServer. Device console's logs:

I've tried to catch event with:

  1. MPRemoteCommandCenter
MPRemoteCommandCenter* remoteCommandCenter = [MPRemoteCommandCenter sharedCommandCenter];
    [[remoteCommandCenter togglePlayPauseCommand] addTarget:_sharedService action:@selector(didPressPlayPauseCommand)];

The approach works for headset, but not for Bluetooth handsfree.

  1. UIApplication -beginReceivingRemoteControlEvents
The same behaviour, as with MPRemoteCommandCenter. Doesn't work with bluetooth devices, but works with headset.

So, have anyone ideas, how to do the same job as it does WhatsApp?

Feel free to suggest anything on Swift. Any ideas? :)

Andrei
  • 114
  • 6
  • It looks like you're trying to listen for phone call events. Have you tried working with CallKit? You could view any related events and update your app state accordingly. – Christopher Larsen Jun 07 '17 at 15:46
  • @ChristopherLarsen Actually, I can't use CallKit due to, min version of my app is iOS 8. Any other ideas, how can I handle events? – Andrei Jun 12 '17 at 09:31
  • Think you can use CTCallCenter from CoreTelephony for pre iOS10 https://developer.apple.com/documentation/coretelephony/ctcallcenter – Christopher Larsen Jun 12 '17 at 15:10

0 Answers0