Impelemented native Crisp chat sdk on android and ios

Overview

crisp_chat_sdk

Impelemented native Crisp chat sdk on android and ios

Preview

Screen Shot 2022-02-07 at 6 26 09 PM

Simulator.Screen.Recording.-.iPhone.13.mini.-.2022-02-07.at.18.24.56.mp4

Android implementation:

1-Add: implementation 'androidx.multidex:multidex:2.0.1' to dependencies build.gradle like below:

dependencies {
    …
    implementation 'androidx.multidex:multidex:2.0.1'
}

2-Enable multiDexEnabled true in build.gradle like this:

defaultConfig {
    …
    multiDexEnabled true
}

3-Set min sdk on 19 in build.gradle like below:

defaultConfig {
    …
    multiDexEnabled true

	minSdkVersion 19
}

IOS implementation:

1-Run below commands in terminal in root of project:

cd ios
pod install
Property Description
configure configure the Website ID(Go to your Crisp Dashboard, and copy your Website ID:) ** this method must be called and call before other methods
setTokenID Assigns the next session with a tokenID
resetChatSession Reset the session
setUserAvatar Sets the user avatar
setUserCompany Sets the user company
setUserEmail Sets the user email (note: if email is invalid, this method will return false and the value will not be set)
setUserNickname Sets the user name
setUserPhone Sets the user phone (note: if phone is invalid, this method will return false and the value will not be set)
setSessionBool Sets a session data bool
setSessionInt Sets a session data int
setSessionString Sets a session data string
setSessionSegment Sets a session segment
openChat Open chat view (this method open chat page)

Usage

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:crisp_chat_sdk/crisp_chat_sdk.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              initPlatformState();
            },
            child: const Text('Open crisp chat'),
          ),
        ),
      ),
    );
  }

  Future<void> initPlatformState() async {
    final sdk = CrispChatSdk();
    await sdk.configure(websiteId: "Your WebsiteId");
    await sdk.setUserEmail(email: "[email protected]");
    await sdk.setSessionString(key: "f1KEY", value: "f1value");
    await sdk.setSessionString(key: "f2KEY", value: "f2value");
    await CrispChatSdk().openChat();
  }
}
You might also like...
Simple, Strongly Typed UserDefaults for iOS, macOS and tvOS
Simple, Strongly Typed UserDefaults for iOS, macOS and tvOS

简体中文 DefaultsKit leverages Swift 4's powerful Codable capabilities to provide a Simple and Strongly Typed wrapper on top of UserDefaults. It uses less

A demo app to showcase pixel perfect, modern iOS development with SwiftUI and Combine on MVVM-C architecture.

Pixel_Perfect_SwiftUI A demo app to showcase pixel perfect, modern iOS development with SwiftUI and Combine on MVVM-C architecture. Tech Stack: Swift,

CodableFiles - Save and load Codable objects from DocumentDirectory on iOS Devices.
CodableFiles - Save and load Codable objects from DocumentDirectory on iOS Devices.

Welcome to CodableFiles, a simple library that provides an easier way to save, load or delete Codable objects in Documents directory. It’s primarily a

xFonts is an app that lets you install custom fonts on iOS and iPadOS.

xFonts xFonts is an app that lets you install custom fonts on iOS and iPadOS. Grab fonts from your iCloud Drive or Dropbox and add them to your collec

Ios-App-ication-Swift - A simple iOS application made in Xcode using Swift
Ios-App-ication-Swift - A simple iOS application made in Xcode using Swift

📱 iPhone Calculator A simple iOS application made in Xcode using Swift. This ap

Elegant library to manage the interactions between view and model in Swift
Elegant library to manage the interactions between view and model in Swift

An assistant to manage the interactions between view and model ModelAssistant is a mediator between the view and model. This framework is tailored to

Store and retrieve Codable objects to various persistence layers, in a couple lines of code!
Store and retrieve Codable objects to various persistence layers, in a couple lines of code!

tl;dr You love Swift's Codable protocol and use it everywhere, who doesn't! Here is an easy and very light way to store and retrieve Codable objects t

🛶Shallows is a generic abstraction layer over lightweight data storage and persistence.

Shallows Shallows is a generic abstraction layer over lightweight data storage and persistence. It provides a StorageKey, Value type, instances of w

Comments
Owner
mohammad mohammadi
Loves flutter, kotlin, android, iOS and everythings.
mohammad mohammadi
A practical interface to the Steamworks SDK using the Swift C++ importer

steamworks-swift A practical interface to the Steamworks SDK using the Swift C++ importer. Caveat Integrator: The Swift C++ importer is a chaotic scie

Carlos Valencia 4 Oct 17, 2022
Native iOS app for Habitica

Habitica for iOS Native iOS app for Habitica. Contributing For an introduction to the technologies used and how the software is organized, refer to Co

HabitRPG 440 Dec 22, 2022
The BART app for commuters, now native on iOS

Arrival iOS Built with SwiftUI, Arrival is the BART app for commuters. Available for download on the App Store: https://apps.apple.com/us/app/arrival-

Ronan 7 Aug 5, 2022
Unrealm is an extension on RealmCocoa, which enables Swift native types to be saved in Realm.

Unrealm enables you to easily store Swift native Classes, Structs and Enums into Realm . Stop inheriting from Object! Go for Protocol-Oriented program

Artur  Mkrtchyan 518 Dec 13, 2022
🔥 🔥 🔥Support for ORM operation,Customize the PQL syntax for quick queries,Support dynamic query,Secure thread protection mechanism,Support native operation,Support for XML configuration operations,Support compression, backup, porting MySQL, SQL Server operation,Support transaction operations.

?? ?? ??Support for ORM operation,Customize the PQL syntax for quick queries,Support dynamic query,Secure thread protection mechanism,Support native operation,Support for XML configuration operations,Support compression, backup, porting MySQL, SQL Server operation,Support transaction operations.

null 60 Dec 12, 2022
SPM-native private framework bindings

Paris SPM-powered SDK for working with private frameworks. Help me! Currently, using Paris is a bit convoluted. Due to a limitation set by SPM, Paris

Eric Rabil 3 Sep 6, 2022
Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, configurations and app-state. UserDefaults

Prephirences - Preϕrences Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, co

Eric Marchand 557 Nov 22, 2022
Classes-and-structures-in-swift - This source files show what is the difference between class and structure

This source files show what is the difference between class and structure You ca

null 0 Jan 4, 2022
Disk is a powerful and simple file management library built with Apple's iOS Data Storage Guidelines in mind

Disk is a powerful and simple file management library built with Apple's iOS Data Storage Guidelines in mind

Saoud Rizwan 3k Jan 3, 2023