Detect active phone call in Notification Service Extension with CallKit in iOS/Swift

435 Views Asked by At

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.

0

There are 0 best solutions below