uniapp 安卓电话通话监听原生插件

插件介绍

安卓电话通话监听原生插件,支持获取所有录音文件,来电监听,去电监听,挂断电话后返回通话录音文件

插件地址

安卓电话通话监听原生插件 - DCloud 插件市场

使用文档

uniapp 安卓电话通话监听原生插件 

超级福利 

uniapp leven系列插件购买超级福利 

用法

在需要使用插件的页面加载以下代码 

  const module = uni.requireNativePlugin("leven-call-CallModule");

页面内容

<template>
  <view>
    <uni-card title="安卓电话通话监听原生插件">
      <button type="primary" @click="checkCallAutoRecorder">检测是否开启通话自动录音</button>
      <button type="primary" @click="toCallAutoRecorderPage">跳转到开启通话自动录音页面</button>
      <button type="primary" @click="getAllRecorderFiles">获取所有的录音文件</button>
      <button type="primary" @click="registerListener">注册电话监听</button>
      <button type="primary" @click="unRegisterListener">取消电话监听</button>
      <button type="primary" @click="logStr = ''">清空日志</button>
    </uni-card>
    <view>
      <uni-card class="uni-card-box" title="日志">
        <view><text style="font-size: 14px; flex-wrap: wrap;">{{logStr}}</text></view>
      </uni-card>
    </view>
  </view>
</template>

<script>
  const module = uni.requireNativePlugin("leven-call-CallModule");
  export default {
    data() {
      return {
        logStr: "",
      }
    },
    methods: {
      // 检测是否开启通话自动录音
      checkCallAutoRecorder() {
        module.checkCallAutoRecorder(res => {
          this.writeLog(JSON.stringify(res))
        });
      },
      // 跳转到开启通话自动录音页面
      toCallAutoRecorderPage() {
        module.toCallAutoRecorderPage(res => {
          this.writeLog(JSON.stringify(res))
        });
      },
      // 获取所有录音文件
      getAllRecorderFiles() {
        module.getAllRecorderFiles(res => {
          this.writeLog(JSON.stringify(res))
        });
      },
      //注册电话监听
      registerListener() {
        module.registerListener(res => {
          this.writeLog(JSON.stringify(res))
        });
      },
      //取消电话监听
      unRegisterListener() {
        module.unRegisterListener(res => {
          this.writeLog(JSON.stringify(res))
        });
      },
      // 写日志
      writeLog(str) {
        console.log(str)
        let logStr = uni.$lv.date.format(null, "yyyy-mm-dd hh:MM:ss") + " " + str + "\n";
        // let logStr = str + "\n";
        this.logStr = logStr + this.logStr;
      }
    }
  }
</script>

<style>

</style>

 插件方法

  • 检测是否开启通话自动录音
  • 跳转到开启通话自动录音页面
  • 获取所有的录音文件
  • 注册电话监听
  • 取消电话监听
  • 挂断电话
  • 获取所有通话记录
  • 拨打电话
  • 注册短信监听
  • 取消短信监听

具体方法的使用请参考使用说明文档

联系作者

 购买插件前请先试用,试用通过再购买。在试用中如果遇到任何问题,可与作者联系,QQ:334106817,将全力协助你使用本插件。

图片预览

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜中雨滴

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值