FLUTTER ECOSYSTEM

Mastersam07/livechat

모바일 애플리케이션에 모바일 채팅 창을 삽입하기 위한 라이브채팅 플러그인입니다.

라이브 채팅 프로젝트 이미지
Stars
12
Forks
21
최근 푸시(UTC)
2024. 10. 5.
프로젝트 상태
활성
Samuel Abada GitHub avatar
GITHUB User

Samuel Abada ↗

GDE Flutter & Dart

@nexlabstudioNigeria공식 웹사이트 ↗
언어DartJavaSwiftRubyObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

💬 livechat

codecov CI license pub package PRs Welcome GitHub contributors GitHub last commit

A livechat package for embedding mobile chat window in your mobile application.

🎖 Installing

dependencies:
  livechatt: ^1.5.1
⚡️ Import
import 'package:livechatt/livechatt.dart';

🎮 How To Use

Get the Crendentials for your LiveChat

Android
  • Edit AndroidManifest.xml as shown below
Internet and Storage Access
<uses-permission android:name="android.permission.INTERNET"/>
ChatWindow
<activity android:name="com.livechatinc.inappchat.ChatWindowActivity" android:configChanges="orientation|screenSize" />
iOS - Manifest
  • Set minimum deployment target of iOS to 11.0
  • Edit info.plist as shown below
Sending Files From Device Library
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app require access to the microphone.</string>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera.</string>
Having issues running on ios?

Add the below to your podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
    end
  end
end
Dart Usage
  • Regular usage
onPressed: (){
    Livechat.beginChat(LICENSE_NO);
},
  • Cases where there are custom parameters
var cmap = <String, String>{
    'org': 'organizationTextController.text',
    'position': 'positionTextController.text'
};

onPressed: (){
    Livechat.beginChat(
      LICENSE_NO,
      groupId: GROUP_ID,
      visitorName: VISITOR_NAME,
      visitorEmail: VISITOR_EMAIL,
      customParams: cmap,
    );
},

For more info, please, refer to the main.dart in the example.

Embedded Chat Views

The package now supports embedded views for custom positioning within your app’s layout:


var cmap = <String, String>{
    'org': 'organizationTextController.text',
    'position': 'positionTextController.text'
};

Livechat.embeddedChat(
  licenseNo: 'your_license',
  groupId: 'group_id',
  visitorEmail: 'visitor_email',
  visitorName: 'visitor_name',
  customParams: cmap,
)

For more info, please refer to EmbeddedChatWidget in main.dart in the example.

Events Streaming

Android only

The plugin streams various events such as new messages, visibility changes, and errors from the chat window. You can listen to events like this:

Livechat.chatEvents.listen((event) {
  print(event);
});

For specific events, you can stream:

New Messages:
Livechat.newMessages.listen((message) {
  print(message); 
});
Visibility Changes:
Livechat.visibilityChanges.listen((isVisible) {
  print("Chat Window is visible: $isVisible");
});
Errors:
Livechat.errors.listen((error) {
  print("Error: ${error['errorDescription']}");
});
Uri handling:
Livechat.uriHandlers.listen((message) {
  print(message); 
});
File picker activity:
Livechat.filePickerActivity.listen((message) {
  print(message); 
});
Window initialization:
Livechat.windowInitialized.listen((message) {
  print(message); 
});

For more info, please refer to EmbeddedChatWidget in main.dart in the example.

Views

https://github.com/Mastersam07/livechat/raw/master/assets/1.pnghttps://github.com/Mastersam07/livechat/raw/master/assets/2.png

🐛 Bugs/Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github and I'll look into it. Pull request are also welcome.

❗️ Note

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

🤓 Developer(s)

https://avatars3.githubusercontent.com/u/31275429?s=460&u=b935d608a06c1604bae1d971e69a731480a27d46&v=4

Abada Samuel Oghenero

https://github.com/aritraroy/social-icons/blob/master/twitter-icon.png?raw=true https://github.com/aritraroy/social-icons/blob/master/linkedin-icon.png?raw=true https://github.com/aritraroy/social-icons/blob/master/medium-icon.png?raw=true https://github.com/aritraroy/social-icons/blob/master/facebook-icon.png?raw=true

⭐️ License

MIT LICENSE