使用 iPhone SDK 访问 iPhone 的通话记录 [英] Accessing the iPhone's Call log with the iPhone SDK

查看:27
本文介绍了使用 iPhone SDK 访问 iPhone 的通话记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建需要 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.

通话记录仅存在于设备上,而不存在于模拟器上.我一直无法让它在运行 Fireware 2.1 的第一代 iPhone 上运行.

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);
}

我怀疑 Apple 正在阻止对该目录的访问作为其沙盒策略的一部分,但现阶段我没有证据.但是,我可以毫无问题地访问地址簿,所以我有点困惑.

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屋!

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