cordova-plugin-call-log2

0.0.4 • Public • Published

npm version

cordova-plugin-call-log2

Cordova plugin to access the call history on a device.

Platforms

  • Android.
  • iOS (TODO)

Installation

cordova plugins add cordova-plugin-call-log2

Usage

Listing all the call logs

// days is how many days back to go
const days = 7;
 
cordova.plugins.callLog.list(days, function (response) {
    console.log(response.rows);
}, function (error) {
    console.error(error)
});

Here the response.rows will be something like:

[
    {
        date: 1590644153980,
        number: "9876543210",
        type: 2,
        duration: 16,
        new: 1,
        cachedNumberType: 0,
        cachedNumberLabel: 0
    }
]

Where type is-

  • 1 === Incoming Call
  • 2 === Outgoing Call
  • 3 === Missed Call
  • 4 === Unknown

Contact a phone number

cordova.plugins.callLog.contact("+919876543210", function (response) {
    console.log(response);
}, function (error) {
    console.error(error)
});

Show a phone number

cordova.plugins.callLog.show("+919876543210", function (response) {
    console.log(response);
}, function (error) {
    console.error(error)
});

Delete a call log

cordova.plugins.callLog.delete("+919876543210", function (response) {
    console.log(response);
}, function (error) {
    console.error(error)
});

/cordova-plugin-call-log2/

    Package Sidebar

    Install

    npm i cordova-plugin-call-log2

    Weekly Downloads

    2

    Version

    0.0.4

    License

    Apache-2.0

    Unpacked Size

    18.6 kB

    Total Files

    7

    Last publish

    Collaborators

    • sagrawal31