Skip to content
Provides call log history for NativeScript mobile applications.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
platforms/android
.npmignore
README.md
call-types.js
calllog-helper.android.js
calllog-model-common.js
calllog-model.android.js
contact-types.js
index.android.js
package.json

README.md

NativeScript Call Log

NPM

Limitations

Currently, it only works on Android.

Usage

  • args.filter[] - Types of calls that we want to get. If you send all three types it's the same as leaving it empty (all calls are returned by default).
  • args.contactType - You can return only calls which are (callLogsService.ContactType.KNOWN)/are not (callLogsService.ContactType.UNKNOWN) in your contact list.
let args = {
    filter: [
        callLogsService.Type.INCOMING,
        callLogsService.Type.OUTCOMING,
        callLogsService.Type.MISSED
    ],
    contactType: callLogsService.ContactType.UNKNOWN
};

callLogsService.getCallLog([args]).then(callLogs => {
    callLogs.data.forEach(callLog => {
        console.log(`${callLog['number']} ${callLog['type']} ${callLog['date']} ${callLog['duration']} ${callLog['contactid']}`);
    })
});

Returned fields

  • number
  • type (callLogsService.Type.INCOMING, callLogsService.Type.OUTCOMING, callLogsService.Type.MISSED)
  • date (timestamp)
  • duration (in seconds)
  • contactid (0 for not saved number)
You can’t perform that action at this time.