livechat_sdk_flutter 1.0.0

SDKflutter
Platformandroidios

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,
    });
参数类型必填说明
accessIdString访问标识
accessSecretString访问秘钥
enterpriseIdString企业号
apiUrlString平台apiUrl
onlineUrlString平台onlineUrl
debugboolean是否开启debug模式
advanceParamsMap<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\":\"电子产品\"}]"
        }
    });

进入会话参数说明

参数类型必填说明
visitorIdString用户App的userID(为空的情况下,系统默认为UUID去除-号,不可包含中文或特殊符号,建议使用用户系统ID方便APP拓展功能)
nicknameString昵称
headUrlString头像地址
mobileString手机号
advanceParamsMap<String, Object>自定义可配参数
titleString页面手机号
cardInfoString商品卡片消息,具体定义看下表

商品卡片消息cardInfo参数说明

参数类型必填说明
subTitleString标题
descriptionString描述
priceString价格
timeString时间
imgString商品图片
statusString送货状态
extraInfoString附加信息(附加信息为json对象数组生成的字符串,json对象含有name和value两个字段)