如何以编程方式在iPhone iOS 5上阅读通话记录 [英] How to read the call log on iPhone iOS 5 programmatically

查看:88
本文介绍了如何以编程方式在iPhone iOS 5上阅读通话记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现许多代码示例用于在iOS 4上阅读通话记录,但似乎在iOS 5上未启用此功能(阅读通话记录数据库)。



<那么解决方案是什么?是否有任何(第三方?)方法或技巧能够在iOS 5中读取通话记录?

解决方案

拿一个查看GitHub上的 SpyPhone 项目。



例如,你可以得到最近拨过的号码如下:

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

这适用于我的iOS5手机。我不希望Apple对这种功能感到满意。


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?

解决方案

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.

这篇关于如何以编程方式在iPhone iOS 5上阅读通话记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆