使用iPhone SDK访问iPhone的通话记录 [英] Accessing the iPhone's Call log with the iPhone SDK
问题描述
我建立的应用程序需要一些来自iPhone的通话记录(只读)的数据。
调用日志是位于 /User/Library/CallHistory/call_history.db 的sqlite数据库。我使用越狱设备提取日志。
然而试图使用 sqlite_open3()命令打开这个位置我得到一个 SQLITE_ERROR 错误,根据库文档意味着SQL错误或缺少数据库 。在试图调试错误我使用NSFileManager枚举文件夹('/ User / Library /')。它似乎返回一个过滤的结果集,排除'CallHistory'文件夹以及几个其他文件夹。
I am building application that required some data from iPhone's Call log(read only). The call log is a sqlite db located at "/User/Library/CallHistory/call_history.db". I used a jailbroken device to extract the log. However trying to open this location using the sqlite_open3() command I get a SQLITE_ERROR error, which according to the library documentation means "SQL error or missing database". In an attempt to debug the error I've used NSFileManager to enumerate the folder('/User/Library/'). It would appear as if it's returning a "filtered" set of results, that exclude the 'CallHistory' folder along with several of the other folders.
文件系统使用一系列别名来给出传统OS X文件结构的错觉,我不知道这些是否对我的结果有影响。
The File system uses a series of alias to give the illusion of tradition OS X file structure, and I don't know if these are having an effect on my results.
通话记录只显示在装置上,而不是模拟器。我已经无法使它工作在第一代iPhone运行fireware 2.1。
The call log is only present on a device, and not the simulator. I've been unable to get it to work on a 1st gen iPhone running fireware 2.1.
这是一些代码我用来测试输出
This is some code I used to test the output
NSDirectoryEnumerator *dirnum = [[NSFileManager defaultManager] enumeratorAtPath: @"/private/var/mobile/Library/"];
while( bar = [dirnum nextObject])
{
//Uncomment if you don't want to log sub folders
//[dirnum skipDescendents];
NSLog(bar);
}
我怀疑苹果正在阻止对该目录的访问沙盒策略,但我在这个阶段没有证据。
I have a suspicion that Apple is blocking access to the directory as part of its sandboxing strategy, however I have no proof at this stage. However, I can access the address book without any issues, so I'm a little confused.
感谢
推荐答案
无法访问Cocoa Touch或其他iPhone API的通话记录。
There is no access to the call log from Cocoa Touch or other iPhone APIs.
这篇关于使用iPhone SDK访问iPhone的通话记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!