What’s the approved way to detect an incoming phone call from a keyboard extension?

How can I detect from an iOS Keyboard Extension if the keyboard is interrupted, for example an incoming phone call.


I have added observers for willResignActive and didBecomeActive in UIInputViewController's viewDidLoad. I have also added logging in those, plus logging in viewWillAppear and viewWillDisappear.


When I get an incoming phone call with my keyboard displayed -- I do not reliably get willResignActive, nor do I reliably get willDisappear.


What’s the approved way to detect an incoming phone call from a keyboard extension?

Replies

I set Xcode "logging" breakpoints on the observers

willResignActive
and
didBecomeActive
to log the name of the breakpoint. Xcode logged
willResignActive
every time my phone received a call and
didBecomeActive
every time the call ended. I am realizing that calls to NSLog and "watching for them" in the Console App on my Mac may not be the correct approach. NSLog/Console seems flaky: i.e., drops NSLog messages.