I am trying to get Call events (call received, call ended etc) I tried to run sample code of CoreTelephonyDemo, but I am not getting any call events. Can anybody guide me for the same.
I tried this code in applicationWillResignActive but I am not getting any events. Am I missing anything or doing anything wrong? Please guide .
- (void)applicationWillResignActive:(UIApplication *)application
{
CTCallCenter *callCenter1 = [[CTCallCenter alloc] init];
callCenter1.callEventHandler=^(CTCall* call)
{
if (call.callState == CTCallStateDisconnected)
{
NSLog(@"Call has been disconnected");
}
else if (call.callState == CTCallStateConnected)
{
NSLog(@"Call has just been connected");
}
else if(call.callState == CTCallStateConnected)
{
NSLog(@"Call is incoming");
}
else
{
NSLog(@"None of the conditions");
}
};
}