How to detect Phone call status in iOS

Posted By : Varun Wadhwa | 19-Jun-2016

How To Detect Phone Call Status In iOS

This blog explain how to detect phone call events in an iOS app.

First of all we need to import CoreTelephony framework. 

 

import CoreTelephony
 

 

Core Telephony framework is  use to obtain details about a user’s cellular service provider and provides us some useful classes like CTCall,

from CTCall instance we can get information about ongoing phone calls, current call status (incoming,dialing,connected and disconnected states).

 

var callCenter = CTCallCenter()

callCenter.callEventHandler = {[weak self] (call: CTCall) -> () in                             
                                print(call.callState)
                             }


First of all create an instance of CTCallCenter , which is used to obtain ongoing call and responds accordingly on state change. and the method callState of CTCall returns the state of ongoing call.

call.callState return

CTCallStateIncoming  on Incoming call

CTCallStateConnected when phone call is connected,

CTCallStateDisconnected after call  gets disconnected

and CTCallStateDialling when dialing a phone call.

 

THANKS,

 

About Author

Author Image
Varun Wadhwa

Varun is a mobile developer with experience in various technologies like Titanium , Cordova and native iOS development.

Request for Proposal

Name is required

Comment is required

Sending message..
Yono Rummy YonoRummy Rummy Codes Rummy Promo Codes Rummy Yono App Yono Rummy APK Game Yono Rummy Yono Rummy Games sarkari naukri dunia TOTOSGP TOTO SGP TOTOSGP TOTO SGP TOTOSGP TOTOSGP India Games Online Platform Popular Games in India India Gaming Experience Online Games India Best Rummy Games in India India Games Collection Teen Patti Games India Rummy Games Online India India Rummy Gaming Platform Popular Rummy Platform India Online Rummy Games India India Mobile Gaming India Gaming Platform Indian Online Games India Games and Entertainment India Gaming Community India Online Gaming Platform Teen Patti Online Games India Rummy and Teen Patti Games