-1

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 applicationWillResignActive and applicationDidBecomeActive 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 applicationWillResignActive, nor do I reliably get viewWillDisappear.

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

1 Answers1

-1

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.