whelp_flutter_sdk 0.2.2 copy "whelp_flutter_sdk: ^0.2.2" to clipboard
whelp_flutter_sdk: ^0.2.2 copied to clipboard

Whelp Live Chat SDK for Flutter Android and iOS projects

Whelp Flutter Live Chat Package #

Pub Version License

Whelp Flutter Live Chat Package is a Flutter library that allows you to integrate a live chat feature into your Flutter applications using the Whelp service.

Features #

  • Display a live chat interface provided by the Whelp.
  • Authenticate users for live chat functionality.
  • Customizable for tailoring the live chat interface to your app's branding.

Installation #

To use this package, add whelp_flutter_sdk as a dependency in your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  whelp_flutter_sdk: ^0.2.0

Then, run flutter pub get in your terminal to install the package.

Configuration #

In order to be able to use media attachments in the live chat interface, you must add the following permissions to your app's AndroidManifest.xml for Android and Info.plist for iOS:

Android #

  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.CAMERA"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

iOS #

  <key>NSCameraUsageDescription</key>
  <string>Camera permission is required for live chat media attachments.</string>
  <key>NSPhotoLibraryUsageDescription</key>
  <string>Photo library permission is required for live chat media attachments.</string>

Usage #

To use the Whelp Flutter Live Chat Package, follow these steps:

Import the necessary libraries:

  1. Import the necessary libraries:
import 'package:whelp_flutter_sdk/whelp_flutter_sdk.dart';
  1. Create a WhelpUser instance with user information for authentication:
final WhelpUser user = WhelpUser(
  fullName: 'John Doe',
  phoneNumber: '+1234567890',
  language: 'EN',
  identifier: IdentityIdentifier.email,
);

Here the identifier is based on which the identity and uniquness of the user is determined: if matched, previous chats of the user will be loaded, otherwise a new chat will be created.

  1. Create a WhelpConfig instance with your Whelp application ID and API key:
final WhelpConfig config = WhelpConfig(
  appId: 'your_app_id',
  apiKey: 'your_api_key',
  deviceId: 'device_id'
  disableMoreButton: true,
);
  1. Create a WhelpView widget and pass the user and config as parameters and place it in your app's widget tree:
WhelpView(
  user: user,
  config: config,
)
  1. Run the app, and the Whelp live chat interface will be displayed.

Example #

For a more detailed example, check the example directory in this repository.

Important Note #

To use the live chat functionality, you must sign up for the Whelp and obtain your application ID and API key. Visit Whelp's official website to create an account and get started.

License #

This package is open-source and released under the MIT License.

Issues and Contributions #

Please report any issues or feature requests on the GitHub repository. Contributions are welcome! If you want to contribute to this project, create a pull request, and we'll review it together.