0

I am trying to develop and app that tracks how many minutes are being used for phone calls.

I am trying to get Call events (call received, call ended, etc) in my app. I tried to run the sample code of CoreTelephonyDemo, but I am not getting any call events. I tried this code in applicationWillResignActive but I am not getting any call events.

Below is a sample of what I am working on. Any help/suggestions would be greatly appreciated.

- (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");
        }
    };
}
bbarnhart
  • 6,620
  • 1
  • 40
  • 60
newb1188
  • 21
  • 4
  • Call information is consider private information not available to third-party apps. – Black Frog Oct 21 '13 at 16:02
  • You can track events: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCallCenter/Reference/Reference.html – newb1188 Oct 21 '13 at 16:15

0 Answers0