kl-outbound-package
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

boss子应用外呼SDK文档

安装

npm install kl-boss-iframe-outbound
# 或者
yarn add kl-boss-iframe-outbound

使用说明

  1. 初始化
import Outbound from "kl-boss-iframe-outbound"
const phone = Outbound.create()
  1. call 拨打电话
import Outbound from "kl-boss-iframe-outbound"
const phone = Outbound.create()
phone.call({
  phone: '1327279xxx3',
  callType: 7
})
  1. hungUp 挂断电话
import Outbound from "kl-boss-iframe-outbound"
const phone = Outbound.create()
phone.hangUp()
  1. 通话状态回调监听
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)
})

Readme

Keywords

none

Package Sidebar

Install

npm i kl-outbound-package

Weekly Downloads

3

Version

0.0.1

License

MIT

Unpacked Size

6.85 kB

Total Files

7

Last publish

Collaborators

  • yokochen