插件介绍
安卓电话通话监听原生插件,支持获取所有录音文件,来电监听,去电监听,挂断电话后返回通话录音文件
插件地址
使用文档
超级福利
用法
在需要使用插件的页面加载以下代码
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,将全力协助你使用本插件。
图片预览




2080

被折叠的 条评论
为什么被折叠?



