Sergey Z
Sergey Z

Reputation: 103

What is analog for CTCallStateIncoming in iOS 10?

Before iOS 10 we can use [[self.call callState] isEqualToString:@"CTCallStateIncoming"] to detect incoming calls. In IOS10 callState deprecated and Replaced by CallKit/CXCall.h properties. But there is no such status like "Incoming" in CallKit, they came up with "outgoing", "onHold", "hasConnected", "hasEnded" statuses. I need Incoming or analog. Any workarounds so far? Thank you for any suggestions.

Upvotes: 3

Views: 513

Answers (1)

Stuart M
Stuart M

Reputation: 11588

You should be able to use CallKit's CXCallObserver and CXCall APIs and use the following condition to detect when a given CXCall is incoming (!isOutgoing), has not yet been answered (!hasConnected), and has not ended (!hasEnded):

!cxCall.isOutgoing && !cxCall.hasConnected && !cxCall.hasEnded

Upvotes: 1

Related Questions