Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 1.07 KB

README.md

File metadata and controls

60 lines (46 loc) · 1.07 KB

livechat_sdk

This Flutter plugin supports messaging using live chat service.

Getting Started

Add dependency

Add this to your package's pubspec.yaml file, use git dependency with specific branch

dependencies:
  livechat_sdk:
    git:
      url: https://github.com/tieunt0906/livechat_sdk.git
      ref: develop

then run flutter pub get to install package

Setup API Client

First you need to create chat client to initiate connection with baseUrl and appId parameters

final client = LivechatClient(
    baseUrl: 'websocket url',
    appId: 'your app id',
);

Currently, this package supports you to send 6 message types

  1. Text
client.sendTextMessage('your text message');
  1. Image
client.sendImage('imageUrl', text: 'description');
  1. Audio
client.sendAudio('audioUrl', text: 'description');
  1. Video
client.sendVideo('videoUrl', text: 'description');
  1. File
client.sendFile('fileUrl', text: 'description');
  1. Gallery
client.sendImages(['imageUrl'], text: 'description');