更新记录
1.0.2(2024-06-05)
- 添加支持拦截所有电话号码。
1.0.1(2023-10-22)
1.支持添加黑名单。
1.0.0(2023-06-08)
发布插件
查看更多平台兼容性
Android | Android CPU类型 | iOS |
---|---|---|
适用版本区间:5.0 - 12.0 | armeabi-v7a:支持,arm64-v8a:支持,x86:支持 | × |
原生插件通用使用流程:
- 购买插件,选择该插件绑定的项目。
- 在HBuilderX里找到项目,在manifest的app原生插件配置中勾选模块,如需要填写参数则参考插件作者的文档添加。
- 根据插件作者的提供的文档开发代码,在代码中引用插件,调用插件功能。
- 打包自定义基座,选择插件,得到自定义基座,然后运行时选择自定义基座,进行log输出测试。
- 开发完毕后正式云打包
付费原生插件目前不支持离线打包。
Android 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/android
iOS 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/ios
注意事项:使用HBuilderX2.7.14以下版本,如果同一插件且同一appid下购买并绑定了多个包名,提交云打包界面提示包名绑定不一致时,需要在HBuilderX项目中manifest.json->“App原生插件配置”->”云端插件“列表中删除该插件重新选择
概述
- 支持电话拦截
- 支持拦截号码段:可以自由对号码段修改
- 支持获取通话记录:返回拦截号码、关联归属地、关联电话类型:例如推销电话、呼叫类型:例如拒绝、已接听、未接听
- 支持添加号码类型和添加关联号码类型:添加、删除、获取。例如:推销电话
- 支持添加号码归属地和关联号码归属地:添加、删除、获取。
- 支持白名单:添加、删除、获取。
- 支持权限申请、检查权限
- 支持电话拦截总开关
- 支持黑名单:添加、删除、获取。
- 支持拦截所有号码
温馨提示 如何调用插件
var plugin = uni.requireNativePlugin("yuange-callfilter");
检查权限
callNativeCheckPermission() {
const _this = this;
var ret = plugin.callNativeCheckPermission({
},
(ret) => {
_this.result = JSON.stringify(ret);
})
},
权限申请
callNativeRequestPermission() {
const _this = this;
var ret = plugin.callNativeRequestPermission({
},
(ret) => {
_this.result = JSON.stringify(ret);
})
},
获取通话记录
callNativeFindCallLog() {
const _this = this;
var ret = plugin.callNativeFindCallLog({
},
(ret) => {
_this.result = JSON.stringify(ret);
})
},
添加号码段
callNativeNumberRangAdd() {
const _this = this;
var ret = plugin.callNativeNumberRangAdd({
"phone":_this.phoneRang //号码段
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
删除号码段
callNativeNumberRangDel() {
const _this = this;
var ret = plugin.callNativeNumberRangDel({
'id': _this.id //传入id条件删除
},
(ret) => {
_this.result = JSON.stringify(ret);
})
},
获取号码段
callNativeFindNumberRangAll() {
const _this = this;
var ret = plugin.callNativeFindNumberRangAll({
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
添加归属地
callNativePlaceOwnerShipAdd() {
const _this = this;
var ret = plugin.callNativePlaceOwnerShipAdd({
"place":_this.place ,//位置
"id":_this.id //id
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
添加的归属地的关联
callNativePlaceOwnShipMatchAdd() {
const _this = this;
var ret = plugin.callNativePlaceOwnShipMatchAdd({
"place":_this.place, //归属地
"phone":_this.phone ,//号码段
"id":_this.id
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
删除归属地
callNativePlaceOwnerShipDel() {
const _this = this;
var ret = plugin.callNativePlaceOwnerShipDel({
"id":_this.id //传入id条件删除
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
删除归属地的关联
callNativePlaceOwnShipMatchDel() {
const _this = this;
var ret = plugin.callNativePlaceOwnShipMatchDel({
"id":_this.id // 若传入id则条件删除
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
获取归属地
callNativeFindPlaceOwnerShipAll() {
const _this = this;
var ret = plugin.callNativeFindPlaceOwnerShipAll({
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
获取归属地的关联信息
callNativeFindPlaceOwnShipMatchAll() {
const _this = this;
//分页查询 若想全部查询直接调用此接口callNativeFindPlaceOwnShipMatchAll
var ret = plugin.callNativeFindPlaceOwnShipMatchPage({
'number':0, //当前页数
'pagesize':100 //分页的数量
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
添加电话类型
callNativePhoneTypeAdd() {
const _this = this;
var ret = plugin.callNativePhoneTypeAdd({
"phoneType":_this.phoneType //电话类型
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
添加电话类型的关联
callNativePhoneTypeMatchAdd() {
const _this = this;
var ret = plugin.callNativePhoneTypeMatchAdd({
"phoneType": _this.phoneType, //电话类型
"phone": _this.phone ,//号码
"id":_this.id
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
删除电话类型
callNativePhoneTypeDel() {
const _this = this;
var ret = plugin.callNativePhoneTypeDel({
"id":_this.id //传入id条件删除
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
删除电话类型的关联
callNativePhoneTypeMatchDel() {
const _this = this;
var ret = plugin.callNativePhoneTypeMatchDel({
"id":_this.id //传入id条件删除
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
获取电话类型
callNativeFindPhoneTypeAll() {
const _this = this;
var ret = plugin.callNativeFindPhoneTypeAll({
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
获取电话类型的关联信息
callNativeFindPhoneTypeMatchAll() {
const _this = this;
//分页查询 若想全部查询直接调用此接口callNativeFindPhoneTypeMatchAll
var ret = plugin.callNativeFindPhoneTypeMatchPage({
'number':0, //当前页数
'pagesize':100 //分页的数量
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
添加白名单
callNativeWhiteListAdd() {
const _this = this;
var ret = plugin.callNativeWhiteListAdd({
"phone": _this.phone //手机号
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
删除白名单
callNativeWhiteListDel() {
const _this = this;
var ret = plugin.callNativeWhiteListDel({
'id':_this.id //传入id条件删除
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
获取白名单
callNativeFindWhiteListAll() {
const _this = this;
var ret = plugin.callNativeFindWhiteListAll({},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
拦截开关
callNativeInterceptSwitch() {
const _this = this;
var ret = plugin.callNativeInterceptSwitch({
'interceptSwitch':true //true打开拦截 false关闭拦截
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
添加黑名单
callNativeBlackListAdd() {
const _this = this;
var ret = plugin.callNativeBlackListAdd({
"phone": _this.phone //手机号
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
删除黑名单
callNativeBlackListDel() {
const _this = this;
var ret = plugin.callNativeBlackListDel({
'id':_this.id //传入id条件删除
},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
获取黑名单
callNativeFindBlackListAll() {
const _this = this;
var ret = plugin.callNativeFindBlackListAll({},
(ret) => {
_this.result = JSON.stringify(ret);
})
}
拦截所有号码开关
callNativeInterceptAllPhone() {
const _this = this;
var ret = plugin.callNativeInterceptAllPhone({
'interceptAllPhoneSwitch':true //true打开拦截 false关闭拦截
},
(ret) => {
_this.result = JSON.stringify(ret);
})
},