How to read the call log on iPhone iOS 5 programmatically

天涯浪子 提交于 2020-01-01 11:47:09

问题


I found many code samples for reading the call log on iOS 4, but it seems that this feature (reading the call log DB) is not enabled on iOS 5.

So what is the work-around? Is there any (third party?) method or trick to be able to read the call log in iOS 5?


回答1:


Take a look at the SpyPhone project on GitHub.

For example, you can get the most recently dialed number like so:

NSString *path = @"/var/mobile/Library/Preferences/com.apple.mobilephone.plist";
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
NSString *lastDialed = [NSString stringWithFormat:@"%@", [d valueForKey:@"DialerSavedNumber"]];

This works on my iOS5 phone. I would not expect Apple to be happy with this sort of functionality anymore.



来源:https://stackoverflow.com/questions/10057395/how-to-read-the-call-log-on-iphone-ios-5-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!