How to get call history from iphone?

I am trying to execute the following code, but I cannot access it.

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

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

      

Response result:

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

Help me to access the call_history.db data table.

Thank.

+2


source to share


2 answers


You can get like -

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
}

      



Note: not valid in iOS 5

0


source


Your app is Sandboxed, so you cannot access directories outside of your app directory. There is no Cocoa Touch or Objective C API to access the Call Log



+5


source







All Articles