livechat_sdk_flutter 1.0.0 livechat_sdk_flutter: ^1.0.0 copied to clipboard
The mobile developer toolkit (Flutter Plugin) of the "AICC" online customer service module. Through Plugin.
livechat_sdk_flutter #
The mobile developer toolkit (Flutter Plugin) of the "AICC" online customer service module. Through Plugin.
Supported Platforms
- Android
- IOS
How to Use #
import #
# add this line to your dependencies
livechat_sdk_flutter: ^0.0.1
//import
import 'package:livechat_sdk_flutter/livechat_sdk_flutter.dart';
//可在页面合适位置,例如initState方法内实例化FlutterTosKit类
final _flutterTosKitPlugin = FlutterTosKit();
initPlugin #
_flutterTosKitPlugin
.initPlugin({
"enterpriseId": "8000001",
"accessId": "8758096679544ff189d4a9457747f109",
"accessSecret": "72EBF29CB4614F7AB404EEC07BFF0B1B",
"apiUrl": "https://xxx.com",
"onlineUrl": "https://xxx.com",
"debug": true,
});
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
accessId | String | 是 | 访问标识 |
accessSecret | String | 是 | 访问秘钥 |
enterpriseId | String | 是 | 企业号 |
apiUrl | String | 是 | 平台apiUrl |
onlineUrl | String | 是 | 平台onlineUrl |
debug | boolean | 否 | 是否开启debug模式 |
advanceParams | Map<String, Object> | 否 | 自定义可配参数,可为空 |
enterSession #
_flutterTosKitPlugin.enterSession({
"nickname": 'uniapp体验用户名',//用户昵称
"headUrl": 'https://img2.baidu.com/it/u=1229468480,2938819374&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',//用户头像
"mobile": '135xxxx9206'//手机号
"advanceParams": {
"enableMqtt": false,
},
"title": "在线客服aaa",
"cardInfo": {
"subTitle": "华为P40麒麟990 5G SoC芯片 5000万超感知徕卡三摄 30倍数字变焦",
"description": "这是商品描述,啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦",
"price": "¥ 100",
"time": "2022年3月1日",
"img":
"https://img1.baidu.com/it/u=1963848283,2056721126&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500",
"status": "已到货",
"extraInfo":
"[{\"name\":\"订单号\",\"value\":\"13049234802304\"},{\"name\":\"服务地区\",\"value\":\"北京市\"},{\"name\":\"服务\",\"value\":\"满意\"},{\"name\":\"产品类型\",\"value\":\"电子产品\"}]"
}
});
进入会话参数说明
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
visitorId | String | 否 | 用户App的userID(为空的情况下,系统默认为UUID去除-号,不可包含中文或特殊符号,建议使用用户系统ID方便APP拓展功能) |
nickname | String | 否 | 昵称 |
headUrl | String | 否 | 头像地址 |
mobile | String | 否 | 手机号 |
advanceParams | Map<String, Object> | 否 | 自定义可配参数 |
title | String | 否 | 页面手机号 |
cardInfo | String | 否 | 商品卡片消息,具体定义看下表 |
商品卡片消息cardInfo参数说明
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
subTitle | String | 否 | 标题 |
description | String | 否 | 描述 |
price | String | 否 | 价格 |
time | String | 否 | 时间 |
img | String | 否 | 商品图片 |
status | String | 否 | 送货状态 |
extraInfo | String | 否 | 附加信息(附加信息为json对象数组生成的字符串,json对象含有name和value两个字段) |