Search code examples
iphoneios4event-handlingcore-telephony

How create a custom event handler for ctcall center? iphone


I am working on an application in which i have a requirement of detect call log info.

Means when ever a call coming and going and then after attending call that will disconnect. So i have detect and send a notification when call disconnect.

For this requirement i have done so much r&d and get some results but when i go through Apple's doc for core telephony framework then there is class "CTCallCenter". This class provide a event handler which will invoke app whenever a call state change.

Now problem is that when i go through document of that class then i get som texts which is shown below

To handle such call events, define a handler block in your application and assign it to this property. You must implement the handler block to support being invoked from any context.

link of apple doc for core telephony framework

In above text write down that u have to create a event handler and assign to property then it will handle call events.

So problem is that how I create a custom event handler and how make a property and assign to my custom event handler?

Thanks in advance...


Solution

  • Take a look at CoreTelephonyDemo. You will find your answer in there.

    The event handler is a block. You can also look at Blocks Programming Topics