我正在開發使用的是iOS 6,我需要從iOS設備獲得通話記錄編程的的iOS應用。我盡了最大的努力,得到了一個解決方案,但它只能在iOS 5下運行。 是否可以在iOS 5或iOS 6上運行?編程獲取通話記錄的iOS 6
1
A
回答
0
你沒有在ios 5中獲得通話記錄bcoz call_history.db沒有在讀取mode.so你沒有看到這個call_history.db flie.you只能在越獄中閱讀這個數據庫。
+0
確定同意在ios 5 call_history.db但call_history.db在ios5或ios6中的位置是什麼 – Ajay
1
在我的iOS5設備
,通話記錄位置
「/private/var/wireless/Library/CallHistory/call_history.db」
,這裏是我的代碼來檢索調用日誌
- (void)getCallHistory
{
self.callHistories = [NSMutableArray array];
FMDatabase *db = [FMDatabase databaseWithPath:@"/private/var/wireless/Library/CallHistory/call_history.db"];
NSLocale *usLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease];
if([db open]) {
FMResultSet *rs = [db executeQuery:@"select address, date, flags, duration from call order by date"];
while ([rs next]) {
int dateInt = [rs intForColumn:@"date"];
NSDate *date = [NSDate dateWithTimeIntervalSince1970:dateInt];
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"YYYY-MM-dd HH:mm"];
NSString *dateString = [df stringFromDate:date];
int flagsInt = [rs intForColumn:@"flags"];
NSString *flags = @"?";
switch (flagsInt) {
case 4: flags = @"<-"; break;
case 5: flags = @"->"; break;
default: break;
}
int durationInt = [rs intForColumn:@"duration"];
NSString *duration = [NSString stringWithFormat:@"%d:%02d", durationInt/60, durationInt % 60];
NSString *logLine = [NSString stringWithFormat:@"%@ %@ %@ (%@)", dateString, flags, [rs stringForColumn:@"address"], duration];
[callHistories addObject:logLine];
}
[rs close];
rs = [db executeQuery:@"select bytes_rcvd, bytes_sent from data where pdp_ip = 0"];
while ([rs next]) {
double bytes_sent = [rs doubleForColumn:@"bytes_sent"];
double bytes_rcvd = [rs doubleForColumn:@"bytes_rcvd"];
self.prettyBytesSent = [[NSNumber numberWithDouble:bytes_sent] prettyBytes];
self.prettyBytesReceived = [[NSNumber numberWithDouble:bytes_rcvd] prettyBytes];
}
[rs close];
[db close];
}
}
希望它有幫助!
+0
這適用於所有沒有越獄的iPhone? –
相關問題
- 1. 是否有iOS 6「通話記錄」API?
- 2. 如何通過編程讀取iPhone iOS 5上的通話記錄
- 3. iOS通話記錄應用程序
- 4. 以android編程獲取撥入和撥出電話的通話記錄
- 5. 添加VOIP通話記錄到通話記錄IOS
- 6. 從Asterisk獲取通話記錄
- 7. 如何從iPhone獲取通話記錄?
- 8. iOS上的訪問通話記錄
- 9. Navita TEM應用程序如何獲取通話記錄信息?
- 10. 讀取通話記錄從iPhone上的iOS 7
- 11. 如何在Android中獲取電話通話記錄
- 12. 每個通話記錄獲取twilio錄音
- 13. 黑莓手機:如何獲得通話記錄/刪除通話記錄條目
- 14. 如何獲取手機的通話記錄按鈕的ID?
- 15. Android。通話記錄
- 16. android通話記錄
- 17. iOS應用程序:訪問短信和通話記錄
- 18. Android從通話記錄中提取通話的時間
- 19. Android:從通話記錄中獲取唯一的聯繫人
- 20. 獲取通話記錄的回報只持續20個日誌
- 21. 讓服務獲得通話記錄
- 22. 在iPhone OS中讀取通話記錄
- 23. 取黑莓10通話記錄
- 24. 從通話記錄中獲取最後一個通話詳細信息
- 25. j2me中的通話記錄
- 26. Plivo獲取通話錄音的UUID
- 27. 在monotouch中獲取電話記錄
- 28. 通話記錄不保存記錄
- 29. iPhone通話記錄/歷史記錄
- 30. 我想讀取通話記錄歷史記錄
你介意分享你當前的解決方案嗎? – Codo
OP說他試過[this。](http://iosstuff.wordpress.com/2011/08/19/accessing-iphone-call-history/) – 2012-11-02 10:39:40
瀏覽http://iosstuff.wordpress.com/2011/08/19/accessible-iphone-call-history/ 我在iOS 4中獲得通話記錄但是它不適用於iOS 5和iOS 5以上,請幫助我。 –