开发者

Counting missing calls on iPhone/iOS

开发者 https://www.devze.com 2023-03-19 14:42 出处:网络
I\'m quite new at iOS app development. I\'m starting to work on an app that should in somehow be able to count the missing calls that the iPhone has registered since the app is running.

I'm quite new at iOS app development. I'm starting to work on an app that should in somehow be able to count the missing calls that the iPhone has registered since the app is running.

I've read that in no way Apple is going to let me intercept incoming calls, answer them, reject them, or "whatever" them, but开发者_StackOverflow I wonder if we are allowed to count them.

I've found some people that say it can be done (well, I knew it is possible, cause LockInfo does, for instance), but I don't know if it's attached to jailbroken iPhones only.

Anyway, as far as I have seen, it must be done with some methods related to kCTCallStatusChangeNotification from CoreTelephony.h if I'm right (as seen in http://blogs.oreilly.com/digitalmedia/2008/02/when-it-comes-to-the.html), but I coudln't find much more info about it.


Hello and welcome to iPhone Development! :) As you have already pointed out, you can be informed through a notification if a call is happening. Great! But here comes the dark side of iPhone Development:

That's the end of the road. 95% of the "Phone Functionality" of the iPhone is private API and you don't technically have access to it.

Of course, you could header-dump the private frameworks and use them anyway, but that will get your app instantly rejected from the AppStore, which wouldn't be fun for anyone.

LockInfo is an extension for jailbroken devices - those guys are known for not caring too much about Apple nor Private APIs ;) Also, as you may have seen, LockInfo isn't on the AppStore because it would've never made it that far.

So Apple, why is there CoreTelephony?

Well, it's there for some very specific reasons. I personally use it to obtain the carrier name of the device for certain country specific restrictions in my application. The notification you talked about, along with others, tend to be used by developers to prepare your app for going into an inactive state (when the call comes in, your app is put in the background), so its used to pause tasks etc... CoreTelephony has never been intended for any deep level access to the telephone system of the iPhone.

So sorry, you can't obtain the information you're looking for using public APIs.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号