Can I fire an event when ever there is Incoming and Outgoing call ends on iphone? Axample of an event is calling a webservice .
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can, but not necessarily immediately.
There is a framework, called the CoreTelephony framework, which has a
CTCallCenterclass. One of the properties on this class is thecallEventHandlerproperty. This is a block that gets fired when then state of a phone call changes. For example:That’s really about all you can do with this. You don’t get access to any phone numbers. The only other useful tidbit of information is an identifier property on
CTCallso you uniquely identify aCTCallobject.CAUTION:
This event handler is not invoked unless your app is in the foreground! If you make and receive calls while the app is backgrounded, the event handler will not fire until your app becomes active again, at which point (according to the documentation linked to above) the event handler will get invoked once for each call that has changed state while the app was in the background.