패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.4.0

flutter_freshchat

모바일 앱에 Freshchat을 통합하기 위한 Flutter 플러그인입니다.

30일 다운로드
73
좋아요
19
Pub 점수
40

패키지 설치

flutter pub add flutter_freshchat

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

모바일 애플리케이션에 고객 메시징 플랫폼인 프레시챗(Freshchat)을 원활하게 통합할 수 있는 플러터 플러그인입니다. 개발자는 플러터 앱 내부에 실시간 채팅 기능을 직접 삽입하여 사용자와 지원 팀 간의 소통을 용이하게 할 수 있습니다. 이 플러그인은 안드로이드 및 iOS 플랫폼을 모두 지원하며, 다양한 장치에서 일관된 경험을 제공합니다. pub.dev를 통해 최소한의 설정으로 사용자가 앱 내 메시지, 자동 응답, 대화 기록을 통해 참여도를 높일 수 있습니다. 오픈소스 성격 덕분에 커뮤니티 기여와 투명성이 촉진됩니다.

사용 사례

  • 앱 내 고객 지원
  • 실시간 사용자 메시징
  • 고객 서비스 자동화
  • 사용자 참여도 추적
  • 지원 티켓 통합

주요 기능

  • 크로스 플랫폼 호환성
  • pub.dev를 통한 간편한 통합
  • 실시간 채팅 인터페이스
  • 대화 기록 지원
  • 오픈소스 코드베이스

적합한 대상

  • 실시간 채팅이 필요한 모바일 앱
  • 고객 지원 시스템
  • 높은 사용자 상호작용을 가진 앱
  • Flutter를 사용하는 개발자
  • 오픈소스 솔루션을 원하는 팀

고려 사항

  • Freshchat 계정 설정이 필요합니다
  • Freshchat의 기능 세트에 제한됨
  • 고급 사용 사례를 위해 추가 구성이 필요할 수 있습니다
  • Freshchat 백엔드 안정성에 따라 다릅니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

💬 Flutter Freshchat

A Flutter plugin for integrating Freshchat in your mobile app.

Setup

Android

Add this to your AndroidManifest.xml

<provider
    android:name="android.support.v4.content.FileProvider"
    android:authorities="com.example.demoapp.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/freshchat_file_provider_paths" />
</provider>

If you have migrated to AndroidX your might need change the provider attribute android:name to this:

<provider android:name="androidx.core.content.FileProvider">
</provider>

Add this to your Strings.xml located inside android/src/res/values

<string name="freshchat_file_provider_authority">com.example.demoapp.provider</string>

Firebase Cloud Messaging support

  1. Add dependency in <app-name>/android/app/build.gradle
dependencies {
  implementation "com.github.freshdesk:freshchat-android:3.3.0"
}
  1. Create FreshchatMessagingService.java (Java, not Kotlin) class to your app in the same directory as your MainActivity class
package com.example.app;

import com.freshchat.consumer.sdk.Freshchat;
import com.google.firebase.messaging.RemoteMessage;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;

public class FreshchatMessagingService extends FlutterFirebaseMessagingService {

    @Override
    public void onNewToken(String token) {
        super.onNewToken(token);
    }

    @Override
    public void onMessageReceived(final RemoteMessage remoteMessage) {
        super.onMessageReceived(remoteMessage);
        if (Freshchat.isFreshchatNotification(remoteMessage)) {
            Freshchat.handleFcmMessage(this, remoteMessage);
        }
    }
}
  1. In AndroidManifest.xml add
<service android:name=".FreshchatMessagingService">
  <intent-filter>
    <action android:name="com.google.firebase.MESSAGING_EVENT" />
  </intent-filter>
</service>
  1. In your Application class change
FlutterFirebaseMessagingService.setPluginRegistrant(this)

to

FreshchatMessagingService.setPluginRegistrant(this)
IOS
  1. Add this to info.plist

    Starting with iOS 10, Apple requires developers to declare access to privacy-sensitive controls ahead of time.

<key>NSPhotoLibraryUsageDescription</key>
<string>To Enable access to Photo Library</string>
<key>NSCameraUsageDescription</key>
<string>To take Images from Camera</string>
  1. If you encounter non-modular header error during project build
error: include of non-modular header inside framework module 'flutter_freshchat.FlutterFreshchatPlugin'
  • Manually in xcode update the FreshchatSDK.h to be in the flutter_freshchat target and public. FreshchatSDK_fix You may have to do this each time your switch or rebuild the xcode project from flutter.

Usage

To use this plugin, add flutter_freshchat as a dependency in your pubspec.yaml file.

import 'package:flutter_freshchat/flutter_freshchat.dart';

Initialize the Freshchat app with appID, appKey & domain which you could get from here: Where to find App ID and App Key

It has following [FreshchatConfig] properties:

  • domain Each Freshchat cluster falls in to one of this domains:

    • US - https://msdk.freshchat.com (default)
    • AU - https://msdk.au.freshchat.com
    • EU - https://msdk.eu.freshchat.com
    • IN - https://msdk.in.freshchat.com
    • US2 - https://msdk.us2.freshchat.com
  • cameraEnabled property is used to either enable or disable camera within freshchat conversation widget. It default value is set to true.

  • gallerySelectionEnabled property is used to either enable or disable gallery within freshchat conversation widget. It default value is set to true.

  • teamMemberInfoVisible property is used to show team member info within freshchat conversation widget. It default value is set to true.

  • responseExpectationEnabled property is used to show exceptions that occur within freshchat conversation widget. It default value is set to true.

  • showNotificationBanner property is used enabled or disable in-app notification banner. It default value is set to true. (NOTE: IOS only).

  • notificationSoundEnabled property is used enabled or disable in-app notification sound. It default value is set to true. (NOTE: IOS only).

await FlutterFreshchat.init(
  appID: 'YOUR_APP_ID_HERE',
  appKey: 'YOUR_APP_KEY_HERE',
  domain: 'https://msdk.freshchat.com'
  );

Update the user info by setting by creating a FreshchatUser object

FreshchatUser user = FreshchatUser.initial();
user.email = "john@test.com";
user.firstName = "john";
user.lastName = "doe";
user.phoneCountryCode = "+91";
user.phone = "0123456789";

await FlutterFreshchat.updateUserInfo(user: user);

// Custom properties can be set by creating a Map<String, String>
Map<String, String> customProperties = Map<String, String>();
customProperties["loggedIn"] = "true";

await FlutterFreshchat.updateUserInfo(user: user, customProperties: customProperties);

Identify the user user by usin email address or any way you uniquely identify the user. externalID is required and returns a restoreID you can save it and use to restore the chats

await FlutterFreshchat.identifyUser(externalID: 'USER_UNIQUE_ID', restoreID: 'USER_RESTORE_ID');

Show conversation opens a conversation screen and also list all the other conversation if a list obejct is supplied to it. You can also pass a title for the chat screen.

await FlutterFreshchat.showConversations(tags: const [], title: 'CHAT_SCREEN_TITLE');

Send message directly within the app without opening the Freshchat interface. tag is optional.

await FlutterFreshchat.send(message: 'YOUR_MESSAGE_HERE', tag: 'YOUR_TAG_HERE');

ShowFAQs opens a FAQ screen in a grid like format as default you can change the default setting by changing this paramters.
showFaqCategoriesAsGrid = true
showContactUsOnAppBar = true
showContactUsOnFaqScreens = false
showContactUsOnFaqNotHelpful = false

await FlutterFreshchat.showFAQs();

Gets the unseen message count from freshchat you can use this to show a counter.

int count = await FlutterFreshchat.getUnreadMsgCount();

Reset user data at logout or when deemed appropriate based on user action in the app.

await FlutterFreshchat.resetUser();

Example

Find the example wiring in the Flutter_Freshchat example application.

API details

See the flutter_freshchat.dart for more API details

Issues and feedback

Please file issues to send feedback or report a bug. Thank you!

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.