# cordova-plugin-calllistener

> Cordova CallListener Plugin

Latest version **1.3.0** (published 2018-11-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-calllistener
pnpm add cordova-plugin-calllistener
yarn add cordova-plugin-calllistener
bun add cordova-plugin-calllistener
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2018-11-02 |
| First published | 2018-08-09 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | yaoshouyun |
| Maintainers | yaoshouyun |
| Keywords | cordova-plugin-calllistener, cordova-plugin, calllistener, cordova-android, cordova-ios |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-calllistener
- Repository: https://github.com/yaoshouyun/cordova-plugin-calllistener
- Homepage: https://github.com/yaoshouyun/cordova-plugin-calllistener#readme
- Issues: https://github.com/yaoshouyun/cordova-plugin-calllistener/issues
- npm.io page: https://npm.io/package/cordova-plugin-calllistener

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2018-11-02
- 1.2.9 — 2018-10-18
- 1.2.8 — 2018-09-28
- 1.2.7 — 2018-09-26
- 1.2.6 — 2018-09-26
- 1.2.5 — 2018-09-25
- 1.2.4 — 2018-09-18
- 1.2.3 — 2018-09-17
- 1.2.2 — 2018-09-10
- 1.2.1 — 2018-09-10
- 1.2.0 — 2018-09-07
- 1.1.3 — 2018-08-27
- 1.1.2 — 2018-08-27
- 1.1.1 — 2018-08-16
- 1.1.0 — 2018-08-16
- … 8 more at https://npm.io/package/cordova-plugin-calllistener/versions

## README

### 功能：监听电话状态和获取通话时长
### cordova plugin add cordova-plugin-calllistener

  ```javascript

  created () {
    setTimeout(function () {
      /* 监听电话状态（1空闲、2响铃、3通话） */
      window.CallListener.addListener((state) => {
        if (state == 1) {
          /* 获取通话时长（单位秒） */
          CallListener.getCallInfo((info) => {
            Toast.text({
              duration: 3000,
              message: '电话状态：' + state + '，通话时长：' + info.duration + '，开始时间：' + info.start + '，结束时间：' + info.end
            })
          }, '13207180317')
          /* 呼叫指定的手机号码 */
          CallListener.callMobile('13207180317')
        } else {
          Toast.text({
            duration: 3000,
            message: '电话状态：' + state
          })
        }
      })
    },1000)
  },

  ```

---
_Source: https://npm.io/package/cordova-plugin-calllistener · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
