kl-outbound-package
v0.0.1
Published
#### 安装
Downloads
60
Readme
boss子应用外呼SDK文档
安装
npm install kl-boss-iframe-outbound
# 或者
yarn add kl-boss-iframe-outbound
使用说明
- 初始化
import Outbound from "kl-boss-iframe-outbound"
const phone = Outbound.create()
- call 拨打电话
import Outbound from "kl-boss-iframe-outbound"
const phone = Outbound.create()
phone.call({
phone: '1327279xxx3',
callType: 7
})
- hungUp 挂断电话
import Outbound from "kl-boss-iframe-outbound"
const phone = Outbound.create()
phone.hangUp()
- 通话状态回调监听
import { onMounted, onUnmounted } from 'vue'
import Outbound from "kl-boss-iframe-outbound"
const phone = Outbound.create()
const onMessage = (data: BossOutboundIfameBack) => {
console.log(data)
}
phone.onMessage(onMessage)
onUnmounted(() => {
// 注意销毁监听,防止内存泄漏
phone.offMessage(onMessage)
})