2013-04-10 56 views

回答

2

從上面的鏈接,我們只能顯示默認的通話記錄。

0

這可以通過使用CallHistoryService API提供OS 10.3.0

下面是一些示例代碼來獲取所有通話和輸出數字到日誌來完成:

CallHistoryService callHistoryService; 

    // The ID of a valid account is required 
    bb::pim::account::Account defaultAccount = 
           callHistoryService.defaultAccount(); 

    // The default filter will return all calls 
    CallHistoryFilter defaultFilter; 

    // Contact search can be used to identify the contacts 
    CallHistoryParam callHistoryParams; 
    callHistoryParams.setContactSearchEnabled(false); 

    QList<CallEntryResult> callHistoryResults = 
          callHistoryService.callHistory(
           defaultAccount.id(), 
           defaultFilter, 
           callHistoryParams); 


    foreach (const CallEntryResult &callEntryResult, callHistoryResults) { 
     CallEntry callEntry = callEntryResult.call(); 
     qDebug << "Phone number: " << callEntry.phoneNumber(); 
    }