簡體   English   中英

如何從iPhone獲取通話記錄?

[英]How to get call history from iphone?

我嘗試使用以下代碼,但無法訪問。

NSDirectoryEnumerator *dirnum = [[NSFileManager defaultManager] enumeratorAtPath: @"/private/var/mobile/Library/"];

NSLog(@"DirectoryAttributes:%@",[dirnum directoryAttributes]);

回應結果:

“DirectoryAttributes:{
NSFileCreationDate =“ 2008-01-01 05:38:41 GMT”;
NSFileExtensionHidden = 0;
NSFileGroupOwnerAccountID = 501;
NSFileGroupOwnerAccountName =移動;
NSFileModificationDate =“ 2011-07-29 11:38:10 GMT”;
NSFileOwnerAccountID = 501;
NSFileOwnerAccountName =移動;
NSFilePosixPermissions = 493;
NSFileReferenceCount = 26;
NSFileSize = 986;
NSFileSystemFileNumber = 43;
NSFileSystemNumber = 234881026;
NSFileType = NSFileTypeDirectory;
}”

幫我訪問call_history.db數據表。

謝謝。

您的應用是“沙盒”,因此您無法訪問“應用”目錄以外的任何目錄。 沒有可可觸摸或目標C API來訪問呼叫日志

你可以得到-

BOOL callhistoryfileexist = FALSE;

NSFileManager *fileManager = [NSFileManager defaultManager];


callhistoryfileexist = [fileManager fileExistsAtPath:@"/private/var/wireless/Library/CallHistory/call_history.db"];

[fileManager release];

if(callhistoryfileexist)
{
    //copy it where you want it
}

注意:在iOS 5中無效

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM