Require CoreTelephony framework examples

prathumca picture prathumca · Apr 12, 2010 · Viewed 9.2k times · Source

Greetings everyone.

Can any one has a working example for the CoreTelephony framework? I dumped all the CoreTelephony headers using class-dump and added them to "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/System/Library/PrivateFrameworks/CoreTelephony.framework". Now I'm following the Erica's tutorial (http://blogs.oreilly.com/iphone/2008/08/iphone-notifications.html).

I added these following lines of code in my main.m,

  id ct = CTTelephonyCenterGetDefault();
  CTTelephonyCenterAddObserver(
        ct, 
        NULL, 
        callback,
        NULL,
        NULL,
        CFNotificationSuspensionBehaviorHold);

but I'm getting a warning like,

Implicit declaration of function "CTTelephonyCenterGetDefault()" and "CTTelephonyCenterAddObserver(...)".

Can any one has full working example, which will explain how to get the CoreTelepony notifications?

Answer

Tony picture Tony · Sep 28, 2010

I have been successfully using this private framework. The warnings will not prevent your code from running, but you could put the following declaration in your code to get rid of the warning on CTTelephoneCenterGetDefault():

id CTTelephonyCenterGetDefault();

(you can do something similar for the CTTelephonyCenterAddObserver() warning, if you like)