2

I would like to detect if the user is on the phone or not (has an active ongoing call) in my Notification Service Extension whenever a push notification comes in.

I have tried using the CXCallObserver to do this, however this only shows me the correct number of active calls when the application is in the foreground. Once the app is in the background or force-closed, the observer's "calls" parameter always returns an empty array.

Any ideas or solution proposals is more than welcome.

Lehel Medves
  • 527
  • 1
  • 5
  • 15
  • Quick update: the same thing happens if I try to get the number of active calls inside the application (so not in the extension) - if the application is in the foreground, it returns the correct number, when in background it returns 0. – Lehel Medves Oct 22 '20 at 08:38
  • Hello there Did you find a solution for this problem? – AndyB Aug 23 '21 at 19:54
  • Unfortunately this doesn't seem to be possible currently, you can only detect calls that have been started while the application was in the foreground, based on my tests. – Lehel Medves Aug 24 '21 at 12:03
  • Thank you for your fast response. That's sad. We could maybe use the proximity sensor? But then "pocket" use would also trigger it. I want to lower the volume of a critical alert, because it can get very loud if the phone is close to the ear. One of my users complained about that. What do you want to achieve by detecting calls? – AndyB Aug 24 '21 at 14:17

0 Answers0