I'm trying to get the caller number (for jailbroken devices) with this code: extern CFTypeRef CTCallCopyName(void*, CTCall* call);
NSLog(@"%@", CTCallCopyName(NULL, (CTCall*)call));
I receive the error: "CTCallCopyName(void*, CTCall*)", referenced from: ld: symbol(s) not found for architecture armv6
I have Core Telephony linked with my project. Maybe my prototype is wrong... i don't know. Any ideas? Xcode 3, sdk 4
If you're calling this API in a .mm file, you have to declare it like extern "C" void foo(void); As far as I know, on iOS 5 ~ 7, you should use CTCallCopyAddress instead, the prototype is:
Notice that the second arg is a CTCallRef rather than a CTCall, which means you can't send it CTCall class methods (although some of them work). Besides linking CoreTelephony.framework, you can also load this symbol dynamically, as shown below:
BTW, I can't get CTCallCopyName to work in SpringBoard on iOS 5, haven't figured it out or tried on other systems yet. Hope this information helps!
EDIT: Just give it another try on iOS 5, CTCallGetID is the right function to get the caller ID in the addressbook, whose prototype is ABRecordID CTCallGetID(CTCallRef). iOS 6 and 7 are possibly the same.