I used CoreTelephony framework introduced in iOS SDK 4.0 to know about Incoming call & its dropped state.
CTTelephonyNetworkInfo *tni = [[CTTelephonyNetworkInfo alloc] init];
callCenter = [[CTCallCenter alloc] init];
crtCarrierName = tni.subscriberCellularProvider.carrierName;
[callCenter setCallEventHandler:^(CTCall *call) {
if ([[call callState] isEqual:CTCallStateConnected]) {
//this call has just connected
} else if ([[call callState] isEqual:CTCallStateDisconnected]) {
//this call has just ended (dropped/hung up/etc)
}
}];
Can i use this event handler to track call state when my app is in background?
Can i also fetch incoming call phone number from CTCall object? or there is any other way around.
I dont want to use Private API.Is there way available from Apple iOS SDK?