├── ios
├── Assets
│ └── .gitkeep
├── Classes
│ ├── FlutterFreshchatPlugin.h
│ ├── FlutterFreshchatPlugin.m
│ └── SwiftFlutterFreshchatPlugin.swift
├── .gitignore
└── flutter_freshchat.podspec
├── android
├── .idea
│ ├── .name
│ ├── caches
│ │ ├── gradle_models.ser
│ │ └── build_file_checksums.ser
│ ├── modules.xml
│ ├── misc.xml
│ ├── runConfigurations.xml
│ └── gradle.xml
├── gradle.properties
├── settings.gradle
├── .settings
│ └── org.eclipse.buildship.core.prefs
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── .gitignore
├── src
│ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── freshchat
│ │ └── flutter_freshchat
│ │ └── FlutterFreshchatPlugin.java
├── .classpath
├── .project
├── build.gradle
├── gradlew.bat
└── gradlew
├── example
├── ios
│ ├── Runner
│ │ ├── Runner-Bridging-Header.h
│ │ ├── Assets.xcassets
│ │ │ ├── LaunchImage.imageset
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ ├── README.md
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.swift
│ │ ├── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ │ └── Info.plist
│ ├── Flutter
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ ├── flutter_export_environment.sh
│ │ └── AppFrameworkInfo.plist
│ ├── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ └── project.pbxproj
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ ├── Podfile.lock
│ └── Podfile
├── android
│ ├── .settings
│ │ └── org.eclipse.buildship.core.prefs
│ ├── app
│ │ ├── .settings
│ │ │ └── org.eclipse.buildship.core.prefs
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── values
│ │ │ │ │ │ ├── Strings.xml
│ │ │ │ │ │ └── styles.xml
│ │ │ │ │ └── drawable
│ │ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── java
│ │ │ │ │ └── com
│ │ │ │ │ │ └── freshchat
│ │ │ │ │ │ └── flutter_freshchat_example
│ │ │ │ │ │ └── MainActivity.java
│ │ │ │ └── AndroidManifest.xml
│ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ ├── .classpath
│ │ ├── .project
│ │ └── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── .project
│ ├── settings.gradle
│ └── build.gradle
├── .metadata
├── test
│ └── widget_test.dart
├── README.md
├── .gitignore
├── pubspec.yaml
├── lib
│ ├── main.dart
│ └── update_userinfo_screen.dart
└── pubspec.lock
├── .gitignore
├── lib
├── flutter_freshchat.dart
└── src
│ ├── freshchat_user.dart
│ └── freshchat.dart
├── .metadata
├── test
└── flutter_freshchat_test.dart
├── .github
└── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
├── flutter_freshchat.iml
├── LICENSE
├── CHANGELOG.md
├── pubspec.yaml
├── pubspec.lock
└── README.md
/ios/Assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/android/.idea/.name:
--------------------------------------------------------------------------------
1 | flutter_freshchat
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'flutter_freshchat'
2 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 | .idea/
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
--------------------------------------------------------------------------------
/example/android/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/example/android/app/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=..
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/android/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=../example/android
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/android/.idea/caches/gradle_models.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/android/.idea/caches/gradle_models.ser
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.enableJetifier=true
4 | android.useAndroidX=true
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/android/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/android/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Classes/FlutterFreshchatPlugin.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "FreshchatSDK.h"
3 |
4 | @interface FlutterFreshchatPlugin : NSObject
5 | @end
6 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fayeed/flutter_freshchat/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/lib/flutter_freshchat.dart:
--------------------------------------------------------------------------------
1 | library freshchat;
2 |
3 | import 'dart:async';
4 | import 'package:flutter/services.dart';
5 | import 'package:flutter/widgets.dart';
6 |
7 | part 'src/freshchat_user.dart';
8 | part 'src/freshchat.dart';
9 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.freshchat.flutter_freshchat_example.provider
4 |
5 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Dec 04 13:17:39 IST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildSystemType
6 | Original
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713
8 | channel: stable
9 |
10 | project_type: plugin
11 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/android/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/example/android/app/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/test/flutter_freshchat_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/services.dart';
2 | import 'package:flutter_test/flutter_test.dart';
3 | import 'package:flutter_freshchat/flutter_freshchat.dart';
4 |
5 | void main() {
6 | const MethodChannel channel = MethodChannel('flutter_freshchat');
7 |
8 | setUp(() {
9 | channel.setMockMethodCallHandler((MethodCall methodCall) async {
10 | return '42';
11 | });
12 | });
13 |
14 | tearDown(() {
15 | channel.setMockMethodCallHandler(null);
16 | });
17 | }
18 |
--------------------------------------------------------------------------------
/example/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | android
4 | Project android created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.buildship.core.gradleprojectbuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/freshchat/flutter_freshchat_example/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.freshchat.flutter_freshchat_example;
2 |
3 | import android.os.Bundle;
4 | import io.flutter.app.FlutterActivity;
5 | import io.flutter.plugins.GeneratedPluginRegistrant;
6 |
7 | public class MainActivity extends FlutterActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | GeneratedPluginRegistrant.registerWith(this);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/Generated.xcconfig
37 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/example/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | // import 'package:flutter_freshchat_example/main.dart';
12 |
13 | void main() {}
14 |
--------------------------------------------------------------------------------
/example/ios/Flutter/flutter_export_environment.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # This is a generated file; do not edit or check into version control.
3 | export "FLUTTER_ROOT=/Users/USER/Development/flutterapp/flutter"
4 | export "FLUTTER_APPLICATION_PATH=/Users/USER/Development/Dev Plugins/freshchat/example"
5 | export "FLUTTER_TARGET=lib/main.dart"
6 | export "FLUTTER_BUILD_DIR=build"
7 | export "SYMROOT=${SOURCE_ROOT}/../build/ios"
8 | export "FLUTTER_FRAMEWORK_DIR=/Users/USER/Development/flutterapp/flutter/bin/cache/artifacts/engine/ios"
9 | export "FLUTTER_BUILD_NAME=1.0.0"
10 | export "FLUTTER_BUILD_NUMBER=1"
11 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.5.2'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/android/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/android/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # flutter_freshchat_example
2 |
3 | Demonstrates how to use the flutter_freshchat plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.io/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/example/android/app/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | app
4 | Project app created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.buildship.core.gradleprojectbuilder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.buildship.core.gradleprojectnature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ios/Classes/FlutterFreshchatPlugin.m:
--------------------------------------------------------------------------------
1 | #import "FlutterFreshchatPlugin.h"
2 | #if __has_include()
3 | #import
4 | #else
5 | // Support project import fallback if the generated compatibility header
6 | // is not copied when this plugin is created as a library.
7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
8 | #import "flutter_freshchat-Swift.h"
9 | #endif
10 |
11 | @implementation FlutterFreshchatPlugin
12 | + (void)registerWithRegistrar:(NSObject*)registrar {
13 | [SwiftFlutterFreshchatPlugin registerWithRegistrar:registrar];
14 | }
15 | @end
16 |
--------------------------------------------------------------------------------
/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | flutter_freshchat
4 | Project android created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.buildship.core.gradleprojectbuilder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.buildship.core.gradleprojectnature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: "[BUG]"
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. Mac, Windows, Ubuntu]
28 | - Device: [e.g. iPhone6] | Emulator
29 | - Version [e.g. 1.1.7]
30 |
31 | **Additional context**
32 | Add any other context about the problem here.
33 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'com.freshchat.flutter_freshchat'
2 | version '1.0-SNAPSHOT'
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 | }
8 |
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.5.0'
11 | }
12 | }
13 | rootProject.allprojects {
14 | repositories {
15 | google()
16 | jcenter()
17 | maven { url "https://jitpack.io" }
18 | }
19 | }
20 | apply plugin: 'com.android.library'
21 | android {
22 | compileSdkVersion 28
23 |
24 | defaultConfig {
25 | minSdkVersion 16
26 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
27 | }
28 | lintOptions {
29 | disable 'InvalidPackage'
30 | }
31 | }
32 |
33 | dependencies {
34 | implementation 'com.github.freshdesk:freshchat-android:3.3.0'
35 | }
36 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - flutter_freshchat (0.0.4):
4 | - Flutter
5 | - path_provider (0.0.1):
6 | - Flutter
7 |
8 | DEPENDENCIES:
9 | - Flutter (from `.symlinks/flutter/ios`)
10 | - flutter_freshchat (from `.symlinks/plugins/flutter_freshchat/ios`)
11 | - path_provider (from `.symlinks/plugins/path_provider/ios`)
12 |
13 | EXTERNAL SOURCES:
14 | Flutter:
15 | :path: ".symlinks/flutter/ios"
16 | flutter_freshchat:
17 | :path: ".symlinks/plugins/flutter_freshchat/ios"
18 | path_provider:
19 | :path: ".symlinks/plugins/path_provider/ios"
20 |
21 | SPEC CHECKSUMS:
22 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
23 | flutter_freshchat: 6c8631baa242ca51e03fdb86c48db031429527d4
24 | path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
25 |
26 | PODFILE CHECKSUM: ebd43b443038e611b86ede96e613bd6033c49497
27 |
28 | COCOAPODS: 1.8.4
29 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/flutter_freshchat.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Fayeed Pawaskar
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/ios/flutter_freshchat.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
3 | #
4 | Pod::Spec.new do |s|
5 | s.name = 'flutter_freshchat'
6 | s.version = '0.0.4'
7 | s.summary = 'A Flutter plugin for integrating Freshchat in your mobile app.'
8 | s.description = <<-DESC
9 | A Flutter plugin for integrating Freshchat in your mobile app.
10 | DESC
11 | s.homepage = 'https://github.com/fayeed/flutter_freshchat'
12 | s.license = { :file => '../LICENSE' }
13 | s.author = { 'Fayeed Pawaskar' => 'fayeed@live.com' }
14 | s.source = { :git => "https://github.com/freshdesk/freshchat-ios.git", :tag => "3.4.0" }
15 | s.source_files = 'Classes/**/*'
16 | # s.public_header_files = 'Classes/**/*.h'
17 | s.dependency 'Flutter'
18 | s.platform = :ios, '8.0'
19 |
20 | # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
21 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
22 | s.swift_version = '4.2'
23 |
24 | s.frameworks = "Foundation", "AVFoundation", "AudioToolbox", "CoreMedia", "CoreData", "ImageIO", "Photos", "SystemConfiguration", "Security", "WebKit"
25 | s.dependency 'FreshchatSDK'
26 |
27 | s.static_framework = true
28 | end
29 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # Visual Studio Code related
19 | .vscode/
20 |
21 | # Flutter/Dart/Pub related
22 | **/doc/api/
23 | .dart_tool/
24 | .flutter-plugins
25 | .packages
26 | .pub-cache/
27 | .pub/
28 | /build/
29 |
30 | # Android related
31 | **/android/**/gradle-wrapper.jar
32 | **/android/.gradle
33 | **/android/captures/
34 | **/android/gradlew
35 | **/android/gradlew.bat
36 | **/android/local.properties
37 | **/android/**/GeneratedPluginRegistrant.java
38 |
39 | # iOS/XCode related
40 | **/ios/**/*.mode1v3
41 | **/ios/**/*.mode2v3
42 | **/ios/**/*.moved-aside
43 | **/ios/**/*.pbxuser
44 | **/ios/**/*.perspectivev3
45 | **/ios/**/*sync/
46 | **/ios/**/.sconsign.dblite
47 | **/ios/**/.tags*
48 | **/ios/**/.vagrant/
49 | **/ios/**/DerivedData/
50 | **/ios/**/Icon?
51 | **/ios/**/Pods/
52 | **/ios/**/.symlinks/
53 | **/ios/**/profile
54 | **/ios/**/xcuserdata
55 | **/ios/.generated/
56 | **/ios/Flutter/App.framework
57 | **/ios/Flutter/Flutter.framework
58 | **/ios/Flutter/Generated.xcconfig
59 | **/ios/Flutter/app.flx
60 | **/ios/Flutter/app.zip
61 | **/ios/Flutter/flutter_assets/
62 | **/ios/ServiceDefinitions.json
63 | **/ios/Runner/GeneratedPluginRegistrant.*
64 |
65 | # Exceptions to above rules.
66 | !**/ios/**/default.mode1v3
67 | !**/ios/**/default.mode2v3
68 | !**/ios/**/default.pbxuser
69 | !**/ios/**/default.perspectivev3
70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
71 |
--------------------------------------------------------------------------------
/lib/src/freshchat_user.dart:
--------------------------------------------------------------------------------
1 | part of freshchat;
2 |
3 | /// [FreshchatUser] is a User object that provides basic user informtation.
4 | ///
5 | /// You can send basic user information at any point to give you more context
6 | /// on the user when your support agents are messaging back and forth with them.
7 | class FreshchatUser {
8 | String id;
9 | String email;
10 | String referenceId;
11 | DateTime createdTime;
12 | String phone;
13 | String firstName;
14 | String lastName;
15 | String phoneCountryCode;
16 |
17 | FreshchatUser.initial()
18 | : id = "",
19 | email = "",
20 | referenceId = "",
21 | createdTime = DateTime.now(),
22 | phone = "",
23 | firstName = "",
24 | lastName = "",
25 | phoneCountryCode = "";
26 |
27 | FreshchatUser.fromJson(Map json) {
28 | id = json["id"];
29 | email = json["email"];
30 | referenceId = json["reference_id"];
31 | firstName = json["first_name"];
32 | lastName = json["last_name"];
33 | phone = json["phone"];
34 | createdTime = DateTime.parse(json["createdTime"]);
35 | phoneCountryCode = json["phone_country_code"];
36 | }
37 |
38 | Map toJson() {
39 | Map result = Map();
40 |
41 | result['id'] = id;
42 | result['email'] = email;
43 | result['first_name'] = firstName;
44 | result['last_name'] = lastName;
45 | result['phone'] = phone;
46 | result['reference_id'] = referenceId;
47 | result['created_time'] = createdTime.toString();
48 | result['phone_country_code'] = phoneCountryCode;
49 |
50 | return result;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_freshchat_example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | NSCameraUsageDescription
26 | To take Images from Camera
27 | NSPhotoLibraryUsageDescription
28 | To Enable access to Photo Library
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIMainStoryboardFile
32 | Main
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | UIViewControllerBasedStatusBarAppearance
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_freshchat_example
2 | description: Demonstrates how to use the flutter_freshchat plugin.
3 | publish_to: "none"
4 |
5 | environment:
6 | sdk: ">=2.1.0 <3.0.0"
7 |
8 | dependencies:
9 | flutter:
10 | sdk: flutter
11 |
12 | # The following adds the Cupertino Icons font to your application.
13 | # Use with the CupertinoIcons class for iOS style icons.
14 | cupertino_icons: ^0.1.2
15 | localstorage: ^2.0.0
16 |
17 | dev_dependencies:
18 | flutter_test:
19 | sdk: flutter
20 |
21 | flutter_freshchat:
22 | path: ../
23 |
24 | # For information on the generic Dart part of this file, see the
25 | # following page: https://www.dartlang.org/tools/pub/pubspec
26 |
27 | # The following section is specific to Flutter.
28 | flutter:
29 | # The following line ensures that the Material Icons font is
30 | # included with your application, so that you can use the icons in
31 | # the material Icons class.
32 | uses-material-design: true
33 | # To add assets to your application, add an assets section, like this:
34 | # assets:
35 | # - images/a_dot_burr.jpeg
36 | # - images/a_dot_ham.jpeg
37 | # An image asset can refer to one or more resolution-specific "variants", see
38 | # https://flutter.io/assets-and-images/#resolution-aware.
39 | # For details regarding adding assets from package dependencies, see
40 | # https://flutter.io/assets-and-images/#from-packages
41 | # To add custom fonts to your application, add a fonts section here,
42 | # in this "flutter" section. Each entry in this list should have a
43 | # "family" key with the font family name, and a "fonts" key with a
44 | # list giving the asset and other descriptors for the font. For
45 | # example:
46 | # fonts:
47 | # - family: Schyler
48 | # fonts:
49 | # - asset: fonts/Schyler-Regular.ttf
50 | # - asset: fonts/Schyler-Italic.ttf
51 | # style: italic
52 | # - family: Trajan Pro
53 | # fonts:
54 | # - asset: fonts/TrajanPro.ttf
55 | # - asset: fonts/TrajanPro_Bold.ttf
56 | # weight: 700
57 | #
58 | # For details regarding fonts from package dependencies,
59 | # see https://flutter.io/custom-fonts/#from-packages
60 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.4.0
2 |
3 | - Remove incorrect null safe access
4 | - Podspec include swift for umbrella header support
5 | - Include import fallback in .m
6 | - Update IOS README.MD
7 |
8 | ## 1.3.2
9 |
10 | - Fixed Typos
11 |
12 | ## 1.3.1
13 |
14 | - Added support for `domain`.
15 | - Fixed an issue with android where Picaso was unsupported.
16 |
17 | ## 1.3.0
18 |
19 | - Freshchat dependency for android upgraded to `3.3.0`
20 | - Freshchat dependency for IOS upgraded to `3.4.0`
21 |
22 | ## 1.2.6
23 |
24 | - Fixed a issue that was causing a crash on iOS.
25 |
26 | ## 1.2.5
27 |
28 | - A new method added for sending message.
29 |
30 | ## 1.2.4
31 |
32 | - New properties added to `FreshchatConfig`.
33 | - Code documented.
34 | - Namespace updated.
35 |
36 | ## 1.2.3
37 |
38 | - Upgraded iOS sdk to 2.9.0.
39 |
40 | ## 1.2.2
41 |
42 | - Extra info.plist removed from freshchat.
43 |
44 | ## 1.2.1
45 |
46 | - Freshchat android dependency updated to version `2.9.0` from `2.4.1`
47 |
48 | ## 1.2.0
49 |
50 | - Documentation updated
51 |
52 | ## 1.1.8
53 |
54 | - IOS crash fixed
55 |
56 | ## 1.1.7
57 |
58 | - Small type casting issues fixed with IOS plugin
59 |
60 | ## 1.1.6
61 |
62 | - Meta dependency removed & updated the example
63 |
64 | ## 1.1.5
65 |
66 | - A type checking issue in IOS plugin while updating use info fixed
67 |
68 | ## 1.1.4
69 |
70 | - Use application instead of activity to avoid duplicate applications
71 |
72 | ## 1.1.3
73 |
74 | - Fixed as issue with Map class not being imported in android
75 |
76 | ## 1.1.2
77 |
78 | - Added a customProperties field to the updateUserInfo method
79 | - Added support for IOS
80 |
81 | ## 1.1.1
82 |
83 | - Camera enabled option added
84 |
85 | ## 1.1.0
86 |
87 | - Added support for all user properties
88 | - Fixed an issue where installing the same plugin on multiple app would not allow the other app to install due to same ContentProvider was being used
89 |
90 | ## 1.0.0
91 |
92 | - Added support for IOS
93 |
94 | ## 0.0.3
95 |
96 | - MIT License added
97 |
98 | ## 0.0.2
99 |
100 | - README.md updated with links
101 |
102 | ## 0.0.1
103 |
104 | - Initial Release
105 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 28
29 |
30 | lintOptions {
31 | disable 'InvalidPackage'
32 | }
33 |
34 | compileOptions {
35 | sourceCompatibility JavaVersion.VERSION_1_8
36 | targetCompatibility JavaVersion.VERSION_1_8
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.freshchat.flutter_freshchat_example"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
47 | }
48 |
49 | buildTypes {
50 | release {
51 | // TODO: Add your own signing config for the release build.
52 | // Signing with the debug keys for now, so `flutter run --release` works.
53 | signingConfig signingConfigs.debug
54 | }
55 | }
56 | }
57 |
58 | flutter {
59 | source '../..'
60 | }
61 |
62 | dependencies {
63 | testImplementation 'junit:junit:4.12'
64 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
65 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
66 | }
67 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
13 |
18 |
21 |
22 |
29 |
33 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_freshchat
2 | description: A Flutter plugin for integrating Freshchat in your mobile app.
3 | version: 1.4.0
4 | homepage: https://github.com/fayeed/flutter_freshchat
5 |
6 | environment:
7 | sdk: ">=2.1.0 <3.0.0"
8 | flutter: ">=1.12.0 <2.0.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 |
14 | dev_dependencies:
15 | flutter_test:
16 | sdk: flutter
17 |
18 | # For information on the generic Dart part of this file, see the
19 | # following page: https://www.dartlang.org/tools/pub/pubspec
20 |
21 | # The following section is specific to Flutter.
22 | flutter:
23 | # This section identifies this Flutter project as a plugin project.
24 | # The androidPackage and pluginClass identifiers should not ordinarily
25 | # be modified. They are used by the tooling to maintain consistency when
26 | # adding or updating assets for this project.
27 | plugin:
28 | platforms:
29 | android:
30 | package: com.freshchat.flutter_freshchat
31 | pluginClass: FlutterFreshchatPlugin
32 | ios:
33 | pluginClass: FlutterFreshchatPlugin
34 | # To add assets to your plugin package, add an assets section, like this:
35 | # assets:
36 | # - images/a_dot_burr.jpeg
37 | # - images/a_dot_ham.jpeg
38 | #
39 | # For details regarding assets in packages, see
40 | # https://flutter.io/assets-and-images/#from-packages
41 | #
42 | # An image asset can refer to one or more resolution-specific "variants", see
43 | # https://flutter.io/assets-and-images/#resolution-aware.
44 | # To add custom fonts to your plugin package, add a fonts section here,
45 | # in this "flutter" section. Each entry in this list should have a
46 | # "family" key with the font family name, and a "fonts" key with a
47 | # list giving the asset and other descriptors for the font. For
48 | # example:
49 | # fonts:
50 | # - family: Schyler
51 | # fonts:
52 | # - asset: fonts/Schyler-Regular.ttf
53 | # - asset: fonts/Schyler-Italic.ttf
54 | # style: italic
55 | # - family: Trajan Pro
56 | # fonts:
57 | # - asset: fonts/TrajanPro.ttf
58 | # - asset: fonts/TrajanPro_Bold.ttf
59 | # weight: 700
60 | #
61 | # For details regarding fonts in packages, see
62 | # https://flutter.io/custom-fonts/#from-packages
63 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def parse_KV_file(file, separator='=')
14 | file_abs_path = File.expand_path(file)
15 | if !File.exists? file_abs_path
16 | return [];
17 | end
18 | pods_ary = []
19 | skip_line_start_symbols = ["#", "/"]
20 | File.foreach(file_abs_path) { |line|
21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22 | plugin = line.split(pattern=separator)
23 | if plugin.length == 2
24 | podname = plugin[0].strip()
25 | path = plugin[1].strip()
26 | podpath = File.expand_path("#{path}", file_abs_path)
27 | pods_ary.push({:name => podname, :path => podpath});
28 | else
29 | puts "Invalid plugin specification: #{line}"
30 | end
31 | }
32 | return pods_ary
33 | end
34 |
35 | target 'Runner' do
36 | use_frameworks!
37 |
38 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
39 | # referring to absolute paths on developers' machines.
40 | system('rm -rf .symlinks')
41 | system('mkdir -p .symlinks/plugins')
42 |
43 | # Flutter Pods
44 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
45 | if generated_xcode_build_settings.empty?
46 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
47 | end
48 | generated_xcode_build_settings.map { |p|
49 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
50 | symlink = File.join('.symlinks', 'flutter')
51 | File.symlink(File.dirname(p[:path]), symlink)
52 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
53 | end
54 | }
55 |
56 | # Plugin Pods
57 | plugin_pods = parse_KV_file('../.flutter-plugins')
58 | plugin_pods.map { |p|
59 | symlink = File.join('.symlinks', 'plugins', p[:name])
60 | File.symlink(p[:path], symlink)
61 | pod p[:name], :path => File.join(symlink, 'ios')
62 | }
63 | end
64 |
65 | post_install do |installer|
66 | installer.pods_project.targets.each do |target|
67 | target.build_configurations.each do |config|
68 | config.build_settings['ENABLE_BITCODE'] = 'NO'
69 | end
70 | end
71 | end
72 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'dart:async';
3 | import 'update_userinfo_screen.dart';
4 | import 'package:localstorage/localstorage.dart';
5 | import 'package:flutter_freshchat/flutter_freshchat.dart';
6 |
7 | void main() => runApp(MyApp());
8 |
9 | class MyApp extends StatefulWidget {
10 | @override
11 | _MyAppState createState() => _MyAppState();
12 | }
13 |
14 | class _MyAppState extends State {
15 | final scaffoldKey = GlobalKey();
16 | List- items = [
17 | Item(
18 | text: 'Update User Info',
19 | onTap: (context) {
20 | Navigator.push(context,
21 | MaterialPageRoute(builder: (context) => UpdateUserInfoScreen()));
22 | }),
23 | Item(
24 | text: 'Identify User',
25 | onTap: (context) async {
26 | LocalStorage storage = LocalStorage('example_storage');
27 | //Navigate to update email ID and name screen
28 | String uid = await storage.getItem('uid');
29 | String restoreId = await storage.getItem('restoreId');
30 | if (uid == null) {
31 | Scaffold.of(context).showSnackBar(
32 | SnackBar(content: Text("Please update the user info")));
33 | } else if (restoreId == null) {
34 | String newRestoreId =
35 | await FlutterFreshchat.identifyUser(externalID: uid);
36 | await storage.setItem('restoreId', newRestoreId);
37 | } else {
38 | await FlutterFreshchat.identifyUser(
39 | externalID: uid, restoreID: restoreId);
40 | }
41 | }),
42 | Item(
43 | text: 'Show Conversation',
44 | onTap: (context) async {
45 | await FlutterFreshchat.showConversations();
46 | }),
47 | Item(
48 | text: 'Show FAQs',
49 | onTap: (context) async {
50 | await FlutterFreshchat.showFAQs();
51 | }),
52 | Item(
53 | text: 'Get Unread Message Count',
54 | onTap: (context) async {
55 | dynamic val = await FlutterFreshchat.getUnreadMsgCount();
56 | Scaffold.of(context)
57 | .showSnackBar(SnackBar(content: Text("Message count $val")));
58 | }),
59 | Item(
60 | text: 'Setup Notifications',
61 | onTap: () {
62 | //Navigate to update email ID and name screen
63 | }),
64 | Item(
65 | text: 'Reset User',
66 | onTap: (context) async {
67 | await FlutterFreshchat.resetUser();
68 | }),
69 | ];
70 |
71 | @override
72 | void initState() {
73 | super.initState();
74 | initPlatformState();
75 | }
76 |
77 | Future initPlatformState() async {
78 | await FlutterFreshchat.init(
79 | appID: "YOUR_API_KEY_HERE", appKey: "YOUR_APP_KEY_HERE");
80 | }
81 |
82 | @override
83 | Widget build(BuildContext context) {
84 | return MaterialApp(
85 | home: Scaffold(
86 | key: scaffoldKey,
87 | appBar: AppBar(
88 | title: const Text('Flutter Freshchat Example App'),
89 | ),
90 | body: ListView.builder(
91 | padding: const EdgeInsets.all(10.0),
92 | itemBuilder: (context, i) {
93 | return ListItem(
94 | item: items[i].text,
95 | onTap: () => items[i].onTap(context),
96 | );
97 | },
98 | itemCount: items.length,
99 | ),
100 | ),
101 | );
102 | }
103 | }
104 |
105 | class ListItem extends StatelessWidget {
106 | final String item;
107 | final Function onTap;
108 |
109 | ListItem({@required this.item, @required this.onTap});
110 |
111 | @override
112 | Widget build(BuildContext context) {
113 | return GestureDetector(
114 | onTap: onTap,
115 | child: Card(
116 | child: Container(
117 | padding: EdgeInsets.all(8.0),
118 | child: Row(
119 | children: [
120 | new CircleAvatar(
121 | child: Text('A'),
122 | ),
123 | Padding(padding: EdgeInsets.only(right: 10.0)),
124 | Text(item)
125 | ],
126 | ),
127 | ),
128 | ),
129 | );
130 | }
131 | }
132 |
133 | class Item {
134 | String text;
135 | Function onTap;
136 |
137 | Item({@required String text, @required Function onTap}) {
138 | this.text = text;
139 | this.onTap = onTap;
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | archive:
5 | dependency: transitive
6 | description:
7 | name: archive
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.0.11"
11 | args:
12 | dependency: transitive
13 | description:
14 | name: args
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "1.5.2"
18 | async:
19 | dependency: transitive
20 | description:
21 | name: async
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.4.0"
25 | boolean_selector:
26 | dependency: transitive
27 | description:
28 | name: boolean_selector
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.0.5"
32 | charcode:
33 | dependency: transitive
34 | description:
35 | name: charcode
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.2"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.14.11"
46 | convert:
47 | dependency: transitive
48 | description:
49 | name: convert
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "2.1.1"
53 | crypto:
54 | dependency: transitive
55 | description:
56 | name: crypto
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "2.1.3"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_test:
66 | dependency: "direct dev"
67 | description: flutter
68 | source: sdk
69 | version: "0.0.0"
70 | image:
71 | dependency: transitive
72 | description:
73 | name: image
74 | url: "https://pub.dartlang.org"
75 | source: hosted
76 | version: "2.1.4"
77 | matcher:
78 | dependency: transitive
79 | description:
80 | name: matcher
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "0.12.6"
84 | meta:
85 | dependency: transitive
86 | description:
87 | name: meta
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "1.1.8"
91 | path:
92 | dependency: transitive
93 | description:
94 | name: path
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "1.6.4"
98 | pedantic:
99 | dependency: transitive
100 | description:
101 | name: pedantic
102 | url: "https://pub.dartlang.org"
103 | source: hosted
104 | version: "1.8.0+1"
105 | petitparser:
106 | dependency: transitive
107 | description:
108 | name: petitparser
109 | url: "https://pub.dartlang.org"
110 | source: hosted
111 | version: "2.4.0"
112 | quiver:
113 | dependency: transitive
114 | description:
115 | name: quiver
116 | url: "https://pub.dartlang.org"
117 | source: hosted
118 | version: "2.0.5"
119 | sky_engine:
120 | dependency: transitive
121 | description: flutter
122 | source: sdk
123 | version: "0.0.99"
124 | source_span:
125 | dependency: transitive
126 | description:
127 | name: source_span
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "1.5.5"
131 | stack_trace:
132 | dependency: transitive
133 | description:
134 | name: stack_trace
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "1.9.3"
138 | stream_channel:
139 | dependency: transitive
140 | description:
141 | name: stream_channel
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "2.0.0"
145 | string_scanner:
146 | dependency: transitive
147 | description:
148 | name: string_scanner
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "1.0.5"
152 | term_glyph:
153 | dependency: transitive
154 | description:
155 | name: term_glyph
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "1.1.0"
159 | test_api:
160 | dependency: transitive
161 | description:
162 | name: test_api
163 | url: "https://pub.dartlang.org"
164 | source: hosted
165 | version: "0.2.11"
166 | typed_data:
167 | dependency: transitive
168 | description:
169 | name: typed_data
170 | url: "https://pub.dartlang.org"
171 | source: hosted
172 | version: "1.1.6"
173 | vector_math:
174 | dependency: transitive
175 | description:
176 | name: vector_math
177 | url: "https://pub.dartlang.org"
178 | source: hosted
179 | version: "2.0.8"
180 | xml:
181 | dependency: transitive
182 | description:
183 | name: xml
184 | url: "https://pub.dartlang.org"
185 | source: hosted
186 | version: "3.5.0"
187 | sdks:
188 | dart: ">=2.4.0 <3.0.0"
189 |
--------------------------------------------------------------------------------
/example/lib/update_userinfo_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_freshchat/flutter_freshchat.dart';
3 | import 'package:localstorage/localstorage.dart';
4 |
5 | class UpdateUserInfoScreen extends StatefulWidget {
6 | @override
7 | State createState() {
8 | return UpdateUserInfoState();
9 | }
10 | }
11 |
12 | class UpdateUserInfoState extends State {
13 | final formKey = GlobalKey();
14 | final scaffoldKey = GlobalKey();
15 | final LocalStorage storage = LocalStorage('example_storage');
16 |
17 | String _firstName = "";
18 | String _lastName = "";
19 | String _email = "";
20 | String _countryCode = "";
21 | String _phone = "";
22 |
23 | @override
24 | Widget build(BuildContext context) {
25 | return Scaffold(
26 | key: scaffoldKey,
27 | appBar: AppBar(
28 | title: Text("Update User Info"),
29 | ),
30 | body: Container(
31 | padding: EdgeInsets.all(10.0),
32 | height: 500,
33 | width: MediaQuery.of(context).size.width,
34 | child: Form(
35 | key: formKey,
36 | child: Column(
37 | mainAxisAlignment: MainAxisAlignment.spaceAround,
38 | children: [
39 | TextFormField(
40 | decoration: InputDecoration(
41 | hintText: 'xyz', labelText: 'Enter Firstname'),
42 | onSaved: (value) {
43 | this._firstName = value;
44 | },
45 | validator: (value) {
46 | if (value.isEmpty) {
47 | return "Please enter some text";
48 | }
49 | return null;
50 | },
51 | ),
52 | TextFormField(
53 | decoration: InputDecoration(
54 | hintText: 'xyz', labelText: 'Enter Lastname'),
55 | onSaved: (value) {
56 | this._lastName = value;
57 | },
58 | validator: (value) {
59 | if (value.isEmpty) {
60 | return "Please enter some text";
61 | }
62 | return null;
63 | },
64 | ),
65 | TextFormField(
66 | decoration: InputDecoration(
67 | hintText: 'xyz@test.com',
68 | labelText: 'Enter Email address'),
69 | onSaved: (value) {
70 | print(value);
71 | this._email = value;
72 | },
73 | validator: (value) {
74 | if (value.isEmpty) {
75 | return "Please enter some text";
76 | }
77 | return null;
78 | },
79 | ),
80 | Row(
81 | crossAxisAlignment: CrossAxisAlignment.center,
82 | mainAxisAlignment: MainAxisAlignment.start,
83 | children: [
84 | Flexible(
85 | child: TextFormField(
86 | decoration: InputDecoration(
87 | hintText: '+91', labelText: 'Country Code'),
88 | onSaved: (value) {
89 | this._countryCode = value;
90 | },
91 | validator: (value) {
92 | if (value.isEmpty) {
93 | return "Please enter some text";
94 | } else if (value.length < 2) {
95 | return "Please enter 3 characters";
96 | }
97 | return null;
98 | },
99 | ),
100 | ),
101 | SizedBox(
102 | width: 20.0,
103 | ),
104 | Flexible(
105 | child: TextFormField(
106 | decoration: InputDecoration(
107 | hintText: '0123456789', labelText: 'Phone Number'),
108 | onSaved: (value) {
109 | this._phone = value;
110 | },
111 | validator: (value) {
112 | if (value.isEmpty) {
113 | return "Please enter some text";
114 | }
115 | return null;
116 | },
117 | ),
118 | ),
119 | ],
120 | ),
121 | RaisedButton(
122 | onPressed: () async {
123 | if (formKey.currentState.validate()) {
124 | formKey.currentState.save();
125 |
126 | await storage.setItem('uid', this._email);
127 |
128 | FreshchatUser user = FreshchatUser.initial();
129 | user.email = _email;
130 | user.firstName = _firstName;
131 | user.lastName = _lastName;
132 | user.phoneCountryCode = _countryCode;
133 | user.phone = _phone;
134 |
135 | await FlutterFreshchat.updateUserInfo(user: user);
136 |
137 | scaffoldKey.currentState
138 | .showSnackBar(SnackBar(content: Text("Clicked")));
139 | }
140 | },
141 | child: Text("submit"),
142 | )
143 | ],
144 | ),
145 | ),
146 | ),
147 | );
148 | }
149 | }
150 |
--------------------------------------------------------------------------------
/example/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | archive:
5 | dependency: transitive
6 | description:
7 | name: archive
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.0.11"
11 | args:
12 | dependency: transitive
13 | description:
14 | name: args
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "1.5.2"
18 | async:
19 | dependency: transitive
20 | description:
21 | name: async
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.4.0"
25 | boolean_selector:
26 | dependency: transitive
27 | description:
28 | name: boolean_selector
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.0.5"
32 | charcode:
33 | dependency: transitive
34 | description:
35 | name: charcode
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.2"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.14.11"
46 | convert:
47 | dependency: transitive
48 | description:
49 | name: convert
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "2.1.1"
53 | crypto:
54 | dependency: transitive
55 | description:
56 | name: crypto
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "2.1.3"
60 | cupertino_icons:
61 | dependency: "direct main"
62 | description:
63 | name: cupertino_icons
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "0.1.2"
67 | flutter:
68 | dependency: "direct main"
69 | description: flutter
70 | source: sdk
71 | version: "0.0.0"
72 | flutter_freshchat:
73 | dependency: "direct dev"
74 | description:
75 | path: ".."
76 | relative: true
77 | source: path
78 | version: "1.2.5"
79 | flutter_test:
80 | dependency: "direct dev"
81 | description: flutter
82 | source: sdk
83 | version: "0.0.0"
84 | image:
85 | dependency: transitive
86 | description:
87 | name: image
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "2.1.4"
91 | localstorage:
92 | dependency: "direct main"
93 | description:
94 | name: localstorage
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "2.0.0"
98 | matcher:
99 | dependency: transitive
100 | description:
101 | name: matcher
102 | url: "https://pub.dartlang.org"
103 | source: hosted
104 | version: "0.12.6"
105 | meta:
106 | dependency: transitive
107 | description:
108 | name: meta
109 | url: "https://pub.dartlang.org"
110 | source: hosted
111 | version: "1.1.8"
112 | path:
113 | dependency: transitive
114 | description:
115 | name: path
116 | url: "https://pub.dartlang.org"
117 | source: hosted
118 | version: "1.6.4"
119 | path_provider:
120 | dependency: transitive
121 | description:
122 | name: path_provider
123 | url: "https://pub.dartlang.org"
124 | source: hosted
125 | version: "1.1.2"
126 | pedantic:
127 | dependency: transitive
128 | description:
129 | name: pedantic
130 | url: "https://pub.dartlang.org"
131 | source: hosted
132 | version: "1.8.0+1"
133 | petitparser:
134 | dependency: transitive
135 | description:
136 | name: petitparser
137 | url: "https://pub.dartlang.org"
138 | source: hosted
139 | version: "2.4.0"
140 | quiver:
141 | dependency: transitive
142 | description:
143 | name: quiver
144 | url: "https://pub.dartlang.org"
145 | source: hosted
146 | version: "2.0.5"
147 | sky_engine:
148 | dependency: transitive
149 | description: flutter
150 | source: sdk
151 | version: "0.0.99"
152 | source_span:
153 | dependency: transitive
154 | description:
155 | name: source_span
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "1.5.5"
159 | stack_trace:
160 | dependency: transitive
161 | description:
162 | name: stack_trace
163 | url: "https://pub.dartlang.org"
164 | source: hosted
165 | version: "1.9.3"
166 | stream_channel:
167 | dependency: transitive
168 | description:
169 | name: stream_channel
170 | url: "https://pub.dartlang.org"
171 | source: hosted
172 | version: "2.0.0"
173 | string_scanner:
174 | dependency: transitive
175 | description:
176 | name: string_scanner
177 | url: "https://pub.dartlang.org"
178 | source: hosted
179 | version: "1.0.5"
180 | term_glyph:
181 | dependency: transitive
182 | description:
183 | name: term_glyph
184 | url: "https://pub.dartlang.org"
185 | source: hosted
186 | version: "1.1.0"
187 | test_api:
188 | dependency: transitive
189 | description:
190 | name: test_api
191 | url: "https://pub.dartlang.org"
192 | source: hosted
193 | version: "0.2.11"
194 | typed_data:
195 | dependency: transitive
196 | description:
197 | name: typed_data
198 | url: "https://pub.dartlang.org"
199 | source: hosted
200 | version: "1.1.6"
201 | vector_math:
202 | dependency: transitive
203 | description:
204 | name: vector_math
205 | url: "https://pub.dartlang.org"
206 | source: hosted
207 | version: "2.0.8"
208 | xml:
209 | dependency: transitive
210 | description:
211 | name: xml
212 | url: "https://pub.dartlang.org"
213 | source: hosted
214 | version: "3.5.0"
215 | sdks:
216 | dart: ">=2.4.0 <3.0.0"
217 | flutter: ">=0.1.4 <2.0.0"
218 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/lib/src/freshchat.dart:
--------------------------------------------------------------------------------
1 | part of freshchat;
2 |
3 | class FlutterFreshchat {
4 | static const MethodChannel _channel =
5 | const MethodChannel('flutter_freshchat');
6 |
7 | /// Initialize the Freshchat app with `appID` and `appKey` which you could get from here:
8 | /// [Where to find App ID and App Key](https://support.freshchat.com/support/solutions/articles/229192)
9 | ///
10 | /// It has following [FreshchatConfig] properties:
11 | ///
12 | /// `cameraEnabled` property is used to either enable or disable camera
13 | /// within freshchat conversation widget. It default value is set to `true`.
14 | ///
15 | /// `gallerySelectionEnabled` property is used to either enable or disable gallery
16 | /// within freshchat conversation widget. It default value is set to `true`.
17 | ///
18 | /// `teamMemberInfoVisible` property is used to show team member info
19 | /// within freshchat conversation widget. It default value is set to `true`.
20 | ///
21 | /// `responseExpectationEnabled` property is used to show exceptions that occur
22 | /// within freshchat conversation widget. It default value is set to `true`.
23 | ///
24 | /// `showNotificationBanner` property is used enabled or disable in-app notfication
25 | /// banner. It default value is set to `true`. (NOTE: IOS only).
26 | ///
27 | /// `notificationSoundEnabled` property is used enabled or disable in-app notfication
28 | /// sound. It default value is set to `true`. (NOTE: IOS only).
29 | static Future init({
30 | @required String appID,
31 | @required String appKey,
32 | @required String domain,
33 | bool cameraEnabled = true,
34 | bool gallerySelectionEnabled = true,
35 | bool teamMemberInfoVisible = true,
36 | bool responseExpectationEnabled = true,
37 | bool showNotificationBanner = true,
38 | bool notificationSoundEnabled = true,
39 | }) async {
40 | final Map params = {
41 | 'appID': appID,
42 | 'appKey': appKey,
43 | 'domain': domain,
44 | 'cameraEnabled': cameraEnabled,
45 | 'gallerySelectionEnabled': gallerySelectionEnabled,
46 | 'teamMemberInfoVisible': teamMemberInfoVisible,
47 | 'responseExpectationEnabled': responseExpectationEnabled,
48 | 'showNotificationBanner': showNotificationBanner,
49 | 'notificationSoundEnabled': notificationSoundEnabled,
50 | };
51 | final bool result = await _channel.invokeMethod('init', params);
52 |
53 | return result;
54 | }
55 |
56 | /// Update the user info by setting by creating a `FreshchatUser` object
57 | ///
58 | /// Custom properties can be set by using `customProperties` property
59 | ///
60 | /// ```dart
61 | /// Map customProperties = Map();
62 | /// customProperties["loggedIn"] = "true";
63 | /// ```
64 | static Future updateUserInfo({
65 | @required FreshchatUser user,
66 | Map customProperties,
67 | }) async {
68 | Map json = user.toJson();
69 |
70 | json['custom_property_list'] = customProperties;
71 |
72 | final bool result = await _channel.invokeMethod('updateUserInfo', json);
73 |
74 | return result;
75 | }
76 |
77 | /// Identify the user user by usin email address or any way you uniquely
78 | /// identify the user.
79 | ///
80 | /// `externalID` is required and returns a `restoreID` you can save it
81 | /// and use to restore the chats messages.
82 | static Future identifyUser({
83 | @required String externalID,
84 | String restoreID,
85 | }) async {
86 | final Map params = {
87 | "externalID": externalID,
88 | "restoreID": restoreID != null ? restoreID : ""
89 | };
90 |
91 | final String result = await _channel.invokeMethod("identifyUser", params);
92 |
93 | return result;
94 | }
95 |
96 | /// Reset user data at logout or when deemed appropriate based on user action
97 | /// in the app.
98 | static Future resetUser() async {
99 | final bool result = await _channel.invokeMethod('reset');
100 | return result;
101 | }
102 |
103 | /// Show conversation opens a conversation screen and also list all the other
104 | /// conversation if a list obejct is supplied to it.
105 | ///
106 | /// You can also pass a title for the chat screen.
107 | static Future showConversations({
108 | List tags = const [],
109 | String title,
110 | }) async {
111 | final Map params = {
112 | "tags": tags,
113 | "title": title
114 | };
115 | final bool result =
116 | await _channel.invokeMethod('showConversations', params);
117 |
118 | return result;
119 | }
120 |
121 | /// ShowFAQs opens a FAQ screen in a grid like format as default you can change
122 | /// the default setting by changing this paramters.
123 | static Future showFAQs({
124 | bool showFaqCategoriesAsGrid = true,
125 | bool showContactUsOnAppBar = true,
126 | bool showContactUsOnFaqScreens = false,
127 | bool showContactUsOnFaqNotHelpful = false,
128 | }) async {
129 | final Map params = {
130 | "showFaqCategoriesAsGrid": showFaqCategoriesAsGrid,
131 | "showContactUsOnAppBar": showContactUsOnAppBar,
132 | "showContactUsOnFaqScreens": showContactUsOnFaqScreens,
133 | "showContactUsOnFaqNotHelpful": showContactUsOnFaqNotHelpful
134 | };
135 |
136 | final bool result = await _channel.invokeMethod('showFAQs', params);
137 |
138 | return result;
139 | }
140 |
141 | /// Gets the unseen message count from freshchat you can use this to show a counter.
142 | static Future getUnreadMsgCount() async {
143 | final int result = await _channel.invokeMethod('getUnreadMsgCount');
144 | return result;
145 | }
146 |
147 | /// Setup Push notification for freshchat by passing `token` to the methd.
148 | static Future setupPushNotifications({@required String token}) async {
149 | final Map params = {"token": token};
150 |
151 | final bool result =
152 | await _channel.invokeMethod('setupPushNotifications', params);
153 |
154 | return result;
155 | }
156 |
157 | /// Send message
158 | static Future send({@required String message, String tag}) async {
159 | final Map params = {
160 | "message": message,
161 | "tag": tag
162 | };
163 |
164 | final bool result = await _channel.invokeMethod('send', params);
165 |
166 | return result;
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/ios/Classes/SwiftFlutterFreshchatPlugin.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 |
4 | public class SwiftFlutterFreshchatPlugin: NSObject, FlutterPlugin {
5 | private static let METHOD_INIT = "init"
6 | private static let METHOD_IDENTIFY_USER = "identifyUser"
7 | private static let METHOD_UPDATE_USER_INFO = "updateUserInfo"
8 | private static let METHOD_RESET_USER = "reset"
9 | private static let METHOD_SHOW_CONVERSATIONS = "showConversations"
10 | private static let METHOD_SHOW_FAQS = "showFAQs"
11 | private static let METHOD_GET_UNREAD_MESSAGE_COUNT = "getUnreadMsgCount"
12 | private static let METHOD_SETUP_PUSH_NOTIFICATIONS = "setupPushNotifications"
13 | private static let METHOD_SEND_MESSAGE = "send"
14 | private let registrar: FlutterPluginRegistrar
15 |
16 | init(registrar: FlutterPluginRegistrar) {
17 | self.registrar = registrar
18 | }
19 |
20 | private var vc: UIViewController {
21 | get {
22 | return UIApplication.shared.keyWindow!.rootViewController!
23 | }
24 | }
25 |
26 | public static func register(with registrar: FlutterPluginRegistrar) {
27 | let channel = FlutterMethodChannel(name: "flutter_freshchat", binaryMessenger: registrar.messenger())
28 | let instance = SwiftFlutterFreshchatPlugin(registrar: registrar)
29 | registrar.addMethodCallDelegate(instance, channel: channel)
30 | }
31 |
32 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
33 | switch(call.method){
34 | case SwiftFlutterFreshchatPlugin.METHOD_INIT:
35 | let arguments = call.arguments as! [String: Any]
36 | let appID = arguments["appID"] as! String
37 | let appKey = arguments["appKey"] as! String
38 | let domain = arguments["domain"] as! String
39 | let cameraEnabled = arguments["cameraEnabled"] as! Bool
40 | let gallerySelectionEnabled = arguments["gallerySelectionEnabled"] as! Bool
41 | let teamMemberInfoVisible = arguments["teamMemberInfoVisible"] as! Bool
42 | let responseExpectationEnabled = arguments["responseExpectationEnabled"] as! Bool
43 | let showNotificationBanner = arguments["showNotificationBanner"] as! Bool
44 | let notificationSoundEnabled = arguments["notificationSoundEnabled"] as! Bool
45 |
46 | let freshchatConfig = FreshchatConfig.init(appID: appID, andAppKey: appKey)
47 |
48 | freshchatConfig.gallerySelectionEnabled = gallerySelectionEnabled
49 | freshchatConfig.cameraCaptureEnabled = cameraEnabled
50 | freshchatConfig.teamMemberInfoVisible = teamMemberInfoVisible
51 | freshchatConfig.showNotificationBanner = showNotificationBanner
52 | freshchatConfig.responseExpectationVisible = responseExpectationEnabled
53 | freshchatConfig.notificationSoundEnabled = notificationSoundEnabled
54 | freshchatConfig.domain = domain
55 |
56 | Freshchat.sharedInstance().initWith(freshchatConfig)
57 |
58 | result(true)
59 |
60 | case SwiftFlutterFreshchatPlugin.METHOD_IDENTIFY_USER:
61 | let arguments = call.arguments as! [String: String]
62 | let externalId = arguments["externalID"]
63 | var restoreId = arguments["restoreID"]
64 |
65 | if (restoreId == "") {
66 | Freshchat.sharedInstance().identifyUser(withExternalID: externalId!, restoreID: nil)
67 | restoreId = FreshchatUser.sharedInstance().restoreID
68 | } else {
69 | Freshchat.sharedInstance().identifyUser(withExternalID: externalId!, restoreID: restoreId)
70 | }
71 | result(restoreId)
72 |
73 | case SwiftFlutterFreshchatPlugin.METHOD_UPDATE_USER_INFO:
74 | let arguments = call.arguments as! [String: Any]
75 | let customProperties = arguments["custom_property_list"] as? [String: String]
76 | let user = FreshchatUser.sharedInstance()
77 | user.firstName = arguments["first_name"] as? String
78 | user.lastName = arguments["last_name"] as? String
79 | user.phoneNumber = arguments["phone"] as? String
80 | user.email = arguments["email"] as? String
81 | user.phoneCountryCode = arguments["phone_country_code"] as? String
82 |
83 | Freshchat.sharedInstance().setUser(user)
84 |
85 | for (kind, value) in customProperties ?? [:] {
86 | Freshchat.sharedInstance().setUserPropertyforKey(kind, withValue: value)
87 | }
88 |
89 | result(true)
90 |
91 | case SwiftFlutterFreshchatPlugin.METHOD_SHOW_CONVERSATIONS:
92 | let arguments = call.arguments as! [String: Any]
93 | let tags = arguments["tags"] as! [String]
94 | let title = arguments["title"] as? String
95 |
96 | if (tags.count > 0) {
97 | let options = ConversationOptions.init()
98 | options.filter(byTags: tags, withTitle: title)
99 |
100 | Freshchat.sharedInstance().showConversations(vc, with: options)
101 | } else {
102 | Freshchat.sharedInstance().showConversations(vc)
103 | }
104 | result(true)
105 |
106 | case SwiftFlutterFreshchatPlugin.METHOD_SHOW_FAQS:
107 | let arguments = call.arguments as! [String: Bool]
108 | let options = FAQOptions.init()
109 | options.showFaqCategoriesAsGrid = arguments["showFaqCategoriesAsGrid"] ?? false
110 | options.showContactUsOnAppBar = arguments["showContactUsOnAppBar"] ?? false
111 | options.showContactUsOnFaqScreens = arguments["showContactUsOnFaqScreens"] ?? false
112 | Freshchat.sharedInstance().showFAQs(vc, with: options)
113 | result(true)
114 |
115 | case SwiftFlutterFreshchatPlugin.METHOD_GET_UNREAD_MESSAGE_COUNT:
116 | Freshchat.sharedInstance().unreadCount { (count:Int) -> Void in
117 | result(count)
118 | }
119 |
120 | case SwiftFlutterFreshchatPlugin.METHOD_SETUP_PUSH_NOTIFICATIONS:
121 | let arguments = call.arguments as! [String: String]
122 | let token:String = arguments["token"] ?? ""
123 | Freshchat.sharedInstance().setPushRegistrationToken(token.data(using: .utf8)!)
124 | result(true)
125 |
126 | case SwiftFlutterFreshchatPlugin.METHOD_RESET_USER:
127 | Freshchat.sharedInstance().resetUser(completion: { () in
128 | result(true)
129 | })
130 |
131 | case SwiftFlutterFreshchatPlugin.METHOD_SEND_MESSAGE:
132 | let arguments = call.arguments as! [String: String]
133 | let message:String = arguments["message"] ?? ""
134 | let tag:String = arguments["tag"] ?? ""
135 | let freshchatMessage = FreshchatMessage.init(message: message, andTag: tag)
136 | Freshchat.sharedInstance().send(freshchatMessage)
137 |
138 | default:
139 | result(false)
140 | }
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
💬 Flutter Freshchat
3 |
4 | A Flutter plugin for integrating Freshchat in your mobile app.
5 |
6 |
7 | ## Setup
8 |
9 | ### Android
10 |
11 | Add this to your `AndroidManifest.xml`
12 |
13 | ```xml
14 |
19 |
22 |
23 | ```
24 |
25 | If you have migrated to AndroidX your might need change the provider attribute `android:name` to this:
26 |
27 | ```xml
28 |
29 |
30 | ```
31 |
32 | Add this to your `Strings.xml` located inside `android/src/res/values`
33 |
34 | ```xml
35 | com.example.demoapp.provider
36 | ```
37 |
38 | **Firebase Cloud Messaging support**
39 |
40 | 1. Add dependency in `/android/app/build.gradle`
41 |
42 | ```gradle
43 | dependencies {
44 | implementation "com.github.freshdesk:freshchat-android:3.3.0"
45 | }
46 | ```
47 |
48 | 2. Create `FreshchatMessagingService.java` (Java, not Kotlin) class to your app in the same directory as your `MainActivity` class
49 |
50 | ```java
51 | package com.example.app;
52 |
53 | import com.freshchat.consumer.sdk.Freshchat;
54 | import com.google.firebase.messaging.RemoteMessage;
55 | import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
56 |
57 | public class FreshchatMessagingService extends FlutterFirebaseMessagingService {
58 |
59 | @Override
60 | public void onNewToken(String token) {
61 | super.onNewToken(token);
62 | }
63 |
64 | @Override
65 | public void onMessageReceived(final RemoteMessage remoteMessage) {
66 | super.onMessageReceived(remoteMessage);
67 | if (Freshchat.isFreshchatNotification(remoteMessage)) {
68 | Freshchat.handleFcmMessage(this, remoteMessage);
69 | }
70 | }
71 | }
72 | ```
73 |
74 | 3. In `AndroidManifest.xml` add
75 |
76 | ```xml
77 |
78 |
79 |
80 |
81 |
82 | ```
83 |
84 | 4. In your `Application` class change
85 | ```java
86 | FlutterFirebaseMessagingService.setPluginRegistrant(this)
87 | ```
88 | to
89 | ```java
90 | FreshchatMessagingService.setPluginRegistrant(this)
91 | ```
92 |
93 | ### IOS
94 |
95 | 1. Add this to info.plist
96 | > Starting with iOS 10, Apple requires developers to declare access to privacy-sensitive controls ahead of time.
97 |
98 | ```xml
99 | NSPhotoLibraryUsageDescription
100 | To Enable access to Photo Library
101 | NSCameraUsageDescription
102 | To take Images from Camera
103 | ```
104 |
105 | 2. If you encounter `non-modular header` error during project build
106 |
107 | ```bash
108 | error: include of non-modular header inside framework module 'flutter_freshchat.FlutterFreshchatPlugin'
109 | ```
110 |
111 | > - Manually in xcode update the FreshchatSDK.h to be in the flutter_freshchat target and public.
112 |
113 | You may have to do this each time your switch or rebuild the xcode project from flutter.
114 |
115 |
122 |
123 | ## Usage
124 |
125 | To use this plugin, add `flutter_freshchat` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
126 |
127 | ```dart
128 | import 'package:flutter_freshchat/flutter_freshchat.dart';
129 | ```
130 |
131 | Initialize the Freshchat app with `appID`, `appKey` & `domain` which you could get from here: [Where to find App ID and App Key](https://support.freshchat.com/support/solutions/articles/229192)
132 | It has following [FreshchatConfig] properties:
133 |
134 | - `domain` Each Freshchat cluster falls in to one of this domains:
135 | - US - https://msdk.freshchat.com (default)
136 | - AU - https://msdk.au.freshchat.com
137 | - EU - https://msdk.eu.freshchat.com
138 | - IN - https://msdk.in.freshchat.com
139 | - US2 - https://msdk.us2.freshchat.com
140 |
141 | - `cameraEnabled` property is used to either enable or disable camera
142 | within freshchat conversation widget. It default value is set to `true`.
143 |
144 | - `gallerySelectionEnabled` property is used to either enable or disable gallery
145 | within freshchat conversation widget. It default value is set to `true`.
146 |
147 | - `teamMemberInfoVisible` property is used to show team member info
148 | within freshchat conversation widget. It default value is set to `true`.
149 |
150 | - `responseExpectationEnabled` property is used to show exceptions that occur
151 | within freshchat conversation widget. It default value is set to `true`.
152 |
153 | - `showNotificationBanner` property is used enabled or disable in-app notification
154 | banner. It default value is set to `true`. (NOTE: IOS only).
155 |
156 | - `notificationSoundEnabled` property is used enabled or disable in-app notification
157 | sound. It default value is set to `true`. (NOTE: IOS only).
158 |
159 | ```dart
160 | await FlutterFreshchat.init(
161 | appID: 'YOUR_APP_ID_HERE',
162 | appKey: 'YOUR_APP_KEY_HERE',
163 | domain: 'https://msdk.freshchat.com'
164 | );
165 | ```
166 |
167 | Update the user info by setting by creating a `FreshchatUser` object
168 |
169 | ```dart
170 | FreshchatUser user = FreshchatUser.initial();
171 | user.email = "john@test.com";
172 | user.firstName = "john";
173 | user.lastName = "doe";
174 | user.phoneCountryCode = "+91";
175 | user.phone = "0123456789";
176 |
177 | await FlutterFreshchat.updateUserInfo(user: user);
178 |
179 | // Custom properties can be set by creating a Map
180 | Map customProperties = Map();
181 | customProperties["loggedIn"] = "true";
182 |
183 | await FlutterFreshchat.updateUserInfo(user: user, customProperties: customProperties);
184 | ```
185 |
186 | Identify the user user by usin email address or any way you uniquely identify the user.
187 | `externalID` is required and returns a `restoreID` you can save it and use to restore the chats
188 |
189 | ```dart
190 | await FlutterFreshchat.identifyUser(externalID: 'USER_UNIQUE_ID', restoreID: 'USER_RESTORE_ID');
191 | ```
192 |
193 | 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.
194 |
195 | ```dart
196 | await FlutterFreshchat.showConversations(tags: const [], title: 'CHAT_SCREEN_TITLE');
197 | ```
198 |
199 | Send message directly within the app without opening the Freshchat interface. `tag` is optional.
200 |
201 | ```dart
202 | await FlutterFreshchat.send(message: 'YOUR_MESSAGE_HERE', tag: 'YOUR_TAG_HERE');
203 | ```
204 |
205 | ShowFAQs opens a FAQ screen in a grid like format as default you can change the default setting by changing this paramters.
206 | `showFaqCategoriesAsGrid = true`
207 | `showContactUsOnAppBar = true`
208 | `showContactUsOnFaqScreens = false`
209 | `showContactUsOnFaqNotHelpful = false`
210 |
211 | ```dart
212 | await FlutterFreshchat.showFAQs();
213 | ```
214 |
215 | Gets the unseen message count from freshchat you can use this to show a counter.
216 |
217 | ```dart
218 | int count = await FlutterFreshchat.getUnreadMsgCount();
219 | ```
220 |
221 | Reset user data at logout or when deemed appropriate based on user action in the app.
222 |
223 | ```dart
224 | await FlutterFreshchat.resetUser();
225 | ```
226 |
227 | ## Example
228 |
229 | Find the example wiring in the [Flutter_Freshchat example application](https://github.com/fayeed/flutter_freshchat/blob/master/example/lib/main.dart).
230 |
231 | ## API details
232 |
233 | See the [flutter_freshchat.dart](https://github.com/fayeed/flutter_freshchat/blob/master/lib/flutter_freshchat.dart) for more API details
234 |
235 | ## Issues and feedback
236 |
237 | Please file [issues](https://github.com/fayeed/flutter_freshchat/issues)
238 | to send feedback or report a bug. Thank you!
239 |
--------------------------------------------------------------------------------
/android/src/main/java/com/freshchat/flutter_freshchat/FlutterFreshchatPlugin.java:
--------------------------------------------------------------------------------
1 | package com.freshchat.flutter_freshchat;
2 |
3 | import android.app.Application;
4 | import android.util.Log;
5 |
6 | import java.util.ArrayList;
7 | import java.util.Map;
8 |
9 | import com.freshchat.consumer.sdk.FaqOptions;
10 | import com.freshchat.consumer.sdk.Freshchat;
11 | import com.freshchat.consumer.sdk.FreshchatCallbackStatus;
12 | import com.freshchat.consumer.sdk.FreshchatConfig;
13 | import com.freshchat.consumer.sdk.FreshchatUser;
14 | import com.freshchat.consumer.sdk.FreshchatMessage;
15 | import com.freshchat.consumer.sdk.ConversationOptions;
16 | import com.freshchat.consumer.sdk.UnreadCountCallback;
17 | import com.freshchat.consumer.sdk.exception.MethodNotAllowedException;
18 |
19 | import io.flutter.plugin.common.MethodCall;
20 | import io.flutter.plugin.common.MethodChannel;
21 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
22 | import io.flutter.plugin.common.MethodChannel.Result;
23 | import io.flutter.plugin.common.PluginRegistry.Registrar;
24 |
25 | public class FlutterFreshchatPlugin implements MethodCallHandler {
26 | private final Application application;
27 |
28 | private static final String METHOD_INIT = "init";
29 | private static final String METHOD_IDENTIFY_USER = "identifyUser";
30 | private static final String METHOD_UPDATE_USER_INFO = "updateUserInfo";
31 | private static final String METHOD_RESET_USER = "reset";
32 | private static final String METHOD_SHOW_CONVERSATIONS = "showConversations";
33 | private static final String METHOD_SHOW_FAQS = "showFAQs";
34 | private static final String METHOD_GET_UNREAD_MESSAGE_COUNT = "getUnreadMsgCount";
35 | private static final String METHOD_SETUP_PUSH_NOTIFICATIONS = "setupPushNotifications";
36 | private static final String METHOD_SEND_MESSAGE = "send";
37 |
38 | public static void registerWith(Registrar registrar) {
39 | final MethodChannel channel = new MethodChannel(registrar.messenger(), "flutter_freshchat");
40 | channel.setMethodCallHandler(new FlutterFreshchatPlugin((Application) registrar.context()));
41 | }
42 |
43 | private FlutterFreshchatPlugin(Application application) {
44 | this.application = application;
45 | }
46 |
47 | @Override
48 | public void onMethodCall(MethodCall call, final Result result) {
49 |
50 | switch (call.method) {
51 | case METHOD_INIT:
52 | final String appID = call.argument("appID");
53 | final String appKey = call.argument("appKey");
54 | final String domain = call.argument("domain");
55 | final boolean cameraEnabled = call.argument("cameraEnabled");
56 | final boolean gallerySelectionEnabled = call.argument("gallerySelectionEnabled");
57 | final boolean teamMemberInfoVisible = call.argument("teamMemberInfoVisible");
58 | final boolean responseExpectationEnabled = call.argument("responseExpectationEnabled");
59 |
60 | Freshchat.setImageLoader(com.freshchat.consumer.sdk.j.af.aw(this.application.getApplicationContext()));
61 | FreshchatConfig freshchatConfig = new FreshchatConfig(appID, appKey);
62 | freshchatConfig.setCameraCaptureEnabled(cameraEnabled);
63 | freshchatConfig.setGallerySelectionEnabled(gallerySelectionEnabled);
64 | freshchatConfig.setResponseExpectationEnabled(responseExpectationEnabled);
65 | freshchatConfig.setTeamMemberInfoVisible(teamMemberInfoVisible);
66 | freshchatConfig.setDomain(domain);
67 | Freshchat.getInstance(this.application.getApplicationContext()).init(freshchatConfig);
68 | result.success(true);
69 | break;
70 | case METHOD_IDENTIFY_USER:
71 | final String externalId = call.argument("externalID");
72 | String restoreId = call.argument("restoreID");
73 |
74 | try {
75 | if (restoreId == "") {
76 | Freshchat.getInstance(this.application.getApplicationContext()).identifyUser(externalId, null);
77 | restoreId = Freshchat.getInstance(this.application.getApplicationContext()).getUser().getRestoreId();
78 | } else {
79 | Freshchat.getInstance(this.application.getApplicationContext()).identifyUser(externalId, restoreId);
80 | }
81 | } catch (MethodNotAllowedException e) {
82 | e.printStackTrace();
83 | result.error("Error while identifying User", "error", e);
84 | }
85 | result.success(restoreId);
86 | break;
87 | case METHOD_UPDATE_USER_INFO:
88 | final String firstName = call.argument("first_name");
89 | final String email = call.argument("email");
90 | final String phone = call.argument("phone");
91 | final String lastName = call.argument("last_name");
92 | final String createdTime = call.argument("created_time");
93 | final String phoneCountryCode = call.argument("phone_country_code");
94 | final Map customProperties = call.argument("custom_property_list");
95 |
96 | FreshchatUser freshchatUser = Freshchat.getInstance(this.application.getApplicationContext()).getUser();
97 | freshchatUser.setFirstName(firstName);
98 | freshchatUser.setEmail(email);
99 | freshchatUser.setPhone(phoneCountryCode, phone);
100 | freshchatUser.setLastName(lastName);
101 |
102 | try {
103 | Freshchat.getInstance(this.application.getApplicationContext()).setUser(freshchatUser);
104 |
105 | if (customProperties != null) {
106 | Freshchat.getInstance(this.application.getApplicationContext()).setUserProperties(customProperties);
107 | }
108 | } catch (MethodNotAllowedException e) {
109 | e.printStackTrace();
110 | result.error("Error while setting User", "error", e);
111 | }
112 | result.success(true);
113 | break;
114 | case METHOD_SHOW_CONVERSATIONS:
115 | final ArrayList tags = call.argument("tags");
116 | final String title = call.argument("title");
117 | if (tags.size() > 0) {
118 | ConversationOptions convOptions = new ConversationOptions().filterByTags(tags, title);
119 | Freshchat.showConversations(this.application, convOptions);
120 | } else {
121 | Freshchat.showConversations(this.application.getApplicationContext());
122 | }
123 | result.success(true);
124 | break;
125 | case METHOD_SHOW_FAQS:
126 | final boolean showFaqCategoriesAsGrid = call.argument("showFaqCategoriesAsGrid");
127 | final boolean showContactUsOnAppBar = call.argument("showContactUsOnAppBar");
128 | final boolean showContactUsOnFaqScreens = call.argument("showContactUsOnFaqScreens");
129 | final boolean showContactUsOnFaqNotHelpful = call.argument("showContactUsOnFaqNotHelpful");
130 |
131 | FaqOptions faqOptions = new FaqOptions().showFaqCategoriesAsGrid(showFaqCategoriesAsGrid)
132 | .showContactUsOnAppBar(showContactUsOnAppBar).showContactUsOnFaqScreens(showContactUsOnFaqScreens)
133 | .showContactUsOnFaqNotHelpful(showContactUsOnFaqNotHelpful);
134 |
135 | Freshchat.showFAQs(this.application, faqOptions);
136 | result.success(true);
137 | break;
138 | case METHOD_GET_UNREAD_MESSAGE_COUNT:
139 | Freshchat.getInstance(this.application.getApplicationContext()).getUnreadCountAsync(new UnreadCountCallback() {
140 | @Override
141 | public void onResult(FreshchatCallbackStatus freshchatCallbackStatus, int i) {
142 | result.success(i);
143 | }
144 | });
145 | break;
146 | case METHOD_SETUP_PUSH_NOTIFICATIONS:
147 | final String token = call.argument("token");
148 | Freshchat.getInstance(this.application.getApplicationContext()).setPushRegistrationToken(token);
149 | result.success(true);
150 | break;
151 | case METHOD_RESET_USER:
152 | Freshchat.resetUser(this.application.getApplicationContext());
153 | result.success(true);
154 | break;
155 | case METHOD_SEND_MESSAGE:
156 | final String message = call.argument("message");
157 | final String tag = call.argument("tag");
158 | FreshchatMessage freshchatMessage = new FreshchatMessage();
159 | freshchatMessage.setTag(tag);
160 | freshchatMessage.setMessage(message);
161 | Freshchat.sendMessage(this.application.getApplicationContext(), freshchatMessage);
162 | result.success(true);
163 | break;
164 | default:
165 | result.notImplemented();
166 | }
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
15 | 74EFEC88DA973158BB7197B3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ACD60DAF1342B0F4BDF3ECC7 /* Pods_Runner.framework */; };
16 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
17 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
18 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
22 | /* End PBXBuildFile section */
23 |
24 | /* Begin PBXCopyFilesBuildPhase section */
25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
26 | isa = PBXCopyFilesBuildPhase;
27 | buildActionMask = 2147483647;
28 | dstPath = "";
29 | dstSubfolderSpec = 10;
30 | files = (
31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
33 | );
34 | name = "Embed Frameworks";
35 | runOnlyForDeploymentPostprocessing = 0;
36 | };
37 | /* End PBXCopyFilesBuildPhase section */
38 |
39 | /* Begin PBXFileReference section */
40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
44 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
45 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
46 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
51 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
52 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
53 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
54 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
55 | ACD60DAF1342B0F4BDF3ECC7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
56 | C12B191C3E7310F50058D2A7 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
57 | CE4AA592DFB07FEBBD386E04 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
58 | E40E2586BBF1CAC14E298DA6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
59 | /* End PBXFileReference section */
60 |
61 | /* Begin PBXFrameworksBuildPhase section */
62 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
63 | isa = PBXFrameworksBuildPhase;
64 | buildActionMask = 2147483647;
65 | files = (
66 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
67 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
68 | 74EFEC88DA973158BB7197B3 /* Pods_Runner.framework in Frameworks */,
69 | );
70 | runOnlyForDeploymentPostprocessing = 0;
71 | };
72 | /* End PBXFrameworksBuildPhase section */
73 |
74 | /* Begin PBXGroup section */
75 | 055A9E68D517C5096A006199 /* Pods */ = {
76 | isa = PBXGroup;
77 | children = (
78 | C12B191C3E7310F50058D2A7 /* Pods-Runner.debug.xcconfig */,
79 | E40E2586BBF1CAC14E298DA6 /* Pods-Runner.release.xcconfig */,
80 | CE4AA592DFB07FEBBD386E04 /* Pods-Runner.profile.xcconfig */,
81 | );
82 | name = Pods;
83 | sourceTree = "";
84 | };
85 | 549DE2EB71A4C480516E73CB /* Frameworks */ = {
86 | isa = PBXGroup;
87 | children = (
88 | ACD60DAF1342B0F4BDF3ECC7 /* Pods_Runner.framework */,
89 | );
90 | name = Frameworks;
91 | sourceTree = "";
92 | };
93 | 9740EEB11CF90186004384FC /* Flutter */ = {
94 | isa = PBXGroup;
95 | children = (
96 | 3B80C3931E831B6300D905FE /* App.framework */,
97 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
98 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
99 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
100 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
101 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
102 | );
103 | name = Flutter;
104 | sourceTree = "";
105 | };
106 | 97C146E51CF9000F007C117D = {
107 | isa = PBXGroup;
108 | children = (
109 | 9740EEB11CF90186004384FC /* Flutter */,
110 | 97C146F01CF9000F007C117D /* Runner */,
111 | 97C146EF1CF9000F007C117D /* Products */,
112 | 055A9E68D517C5096A006199 /* Pods */,
113 | 549DE2EB71A4C480516E73CB /* Frameworks */,
114 | );
115 | sourceTree = "";
116 | };
117 | 97C146EF1CF9000F007C117D /* Products */ = {
118 | isa = PBXGroup;
119 | children = (
120 | 97C146EE1CF9000F007C117D /* Runner.app */,
121 | );
122 | name = Products;
123 | sourceTree = "";
124 | };
125 | 97C146F01CF9000F007C117D /* Runner */ = {
126 | isa = PBXGroup;
127 | children = (
128 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
129 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
130 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
131 | 97C147021CF9000F007C117D /* Info.plist */,
132 | 97C146F11CF9000F007C117D /* Supporting Files */,
133 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
134 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
135 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
136 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
137 | );
138 | path = Runner;
139 | sourceTree = "";
140 | };
141 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
142 | isa = PBXGroup;
143 | children = (
144 | );
145 | name = "Supporting Files";
146 | sourceTree = "";
147 | };
148 | /* End PBXGroup section */
149 |
150 | /* Begin PBXNativeTarget section */
151 | 97C146ED1CF9000F007C117D /* Runner */ = {
152 | isa = PBXNativeTarget;
153 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
154 | buildPhases = (
155 | A4968961046CD2E301E54A69 /* [CP] Check Pods Manifest.lock */,
156 | 9740EEB61CF901F6004384FC /* Run Script */,
157 | 97C146EA1CF9000F007C117D /* Sources */,
158 | 97C146EB1CF9000F007C117D /* Frameworks */,
159 | 97C146EC1CF9000F007C117D /* Resources */,
160 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
161 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
162 | B1B85FB5AB1089D9D5C66B67 /* [CP] Embed Pods Frameworks */,
163 | );
164 | buildRules = (
165 | );
166 | dependencies = (
167 | );
168 | name = Runner;
169 | productName = Runner;
170 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
171 | productType = "com.apple.product-type.application";
172 | };
173 | /* End PBXNativeTarget section */
174 |
175 | /* Begin PBXProject section */
176 | 97C146E61CF9000F007C117D /* Project object */ = {
177 | isa = PBXProject;
178 | attributes = {
179 | LastUpgradeCheck = 0910;
180 | ORGANIZATIONNAME = "The Chromium Authors";
181 | TargetAttributes = {
182 | 97C146ED1CF9000F007C117D = {
183 | CreatedOnToolsVersion = 7.3.1;
184 | LastSwiftMigration = 0910;
185 | };
186 | };
187 | };
188 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
189 | compatibilityVersion = "Xcode 3.2";
190 | developmentRegion = English;
191 | hasScannedForEncodings = 0;
192 | knownRegions = (
193 | en,
194 | Base,
195 | );
196 | mainGroup = 97C146E51CF9000F007C117D;
197 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
198 | projectDirPath = "";
199 | projectRoot = "";
200 | targets = (
201 | 97C146ED1CF9000F007C117D /* Runner */,
202 | );
203 | };
204 | /* End PBXProject section */
205 |
206 | /* Begin PBXResourcesBuildPhase section */
207 | 97C146EC1CF9000F007C117D /* Resources */ = {
208 | isa = PBXResourcesBuildPhase;
209 | buildActionMask = 2147483647;
210 | files = (
211 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
212 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
213 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
214 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
215 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
216 | );
217 | runOnlyForDeploymentPostprocessing = 0;
218 | };
219 | /* End PBXResourcesBuildPhase section */
220 |
221 | /* Begin PBXShellScriptBuildPhase section */
222 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
223 | isa = PBXShellScriptBuildPhase;
224 | buildActionMask = 2147483647;
225 | files = (
226 | );
227 | inputPaths = (
228 | );
229 | name = "Thin Binary";
230 | outputPaths = (
231 | );
232 | runOnlyForDeploymentPostprocessing = 0;
233 | shellPath = /bin/sh;
234 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
235 | };
236 | 9740EEB61CF901F6004384FC /* Run Script */ = {
237 | isa = PBXShellScriptBuildPhase;
238 | buildActionMask = 2147483647;
239 | files = (
240 | );
241 | inputPaths = (
242 | );
243 | name = "Run Script";
244 | outputPaths = (
245 | );
246 | runOnlyForDeploymentPostprocessing = 0;
247 | shellPath = /bin/sh;
248 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
249 | };
250 | A4968961046CD2E301E54A69 /* [CP] Check Pods Manifest.lock */ = {
251 | isa = PBXShellScriptBuildPhase;
252 | buildActionMask = 2147483647;
253 | files = (
254 | );
255 | inputFileListPaths = (
256 | );
257 | inputPaths = (
258 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
259 | "${PODS_ROOT}/Manifest.lock",
260 | );
261 | name = "[CP] Check Pods Manifest.lock";
262 | outputFileListPaths = (
263 | );
264 | outputPaths = (
265 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
266 | );
267 | runOnlyForDeploymentPostprocessing = 0;
268 | shellPath = /bin/sh;
269 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
270 | showEnvVarsInLog = 0;
271 | };
272 | B1B85FB5AB1089D9D5C66B67 /* [CP] Embed Pods Frameworks */ = {
273 | isa = PBXShellScriptBuildPhase;
274 | buildActionMask = 2147483647;
275 | files = (
276 | );
277 | inputPaths = (
278 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
279 | "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
280 | "${BUILT_PRODUCTS_DIR}/flutter_freshchat/flutter_freshchat.framework",
281 | "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
282 | );
283 | name = "[CP] Embed Pods Frameworks";
284 | outputPaths = (
285 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
286 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_freshchat.framework",
287 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
288 | );
289 | runOnlyForDeploymentPostprocessing = 0;
290 | shellPath = /bin/sh;
291 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
292 | showEnvVarsInLog = 0;
293 | };
294 | /* End PBXShellScriptBuildPhase section */
295 |
296 | /* Begin PBXSourcesBuildPhase section */
297 | 97C146EA1CF9000F007C117D /* Sources */ = {
298 | isa = PBXSourcesBuildPhase;
299 | buildActionMask = 2147483647;
300 | files = (
301 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
302 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
303 | );
304 | runOnlyForDeploymentPostprocessing = 0;
305 | };
306 | /* End PBXSourcesBuildPhase section */
307 |
308 | /* Begin PBXVariantGroup section */
309 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
310 | isa = PBXVariantGroup;
311 | children = (
312 | 97C146FB1CF9000F007C117D /* Base */,
313 | );
314 | name = Main.storyboard;
315 | sourceTree = "";
316 | };
317 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
318 | isa = PBXVariantGroup;
319 | children = (
320 | 97C147001CF9000F007C117D /* Base */,
321 | );
322 | name = LaunchScreen.storyboard;
323 | sourceTree = "";
324 | };
325 | /* End PBXVariantGroup section */
326 |
327 | /* Begin XCBuildConfiguration section */
328 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
329 | isa = XCBuildConfiguration;
330 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
331 | buildSettings = {
332 | ALWAYS_SEARCH_USER_PATHS = NO;
333 | CLANG_ANALYZER_NONNULL = YES;
334 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
335 | CLANG_CXX_LIBRARY = "libc++";
336 | CLANG_ENABLE_MODULES = YES;
337 | CLANG_ENABLE_OBJC_ARC = YES;
338 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
339 | CLANG_WARN_BOOL_CONVERSION = YES;
340 | CLANG_WARN_COMMA = YES;
341 | CLANG_WARN_CONSTANT_CONVERSION = YES;
342 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
343 | CLANG_WARN_EMPTY_BODY = YES;
344 | CLANG_WARN_ENUM_CONVERSION = YES;
345 | CLANG_WARN_INFINITE_RECURSION = YES;
346 | CLANG_WARN_INT_CONVERSION = YES;
347 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
348 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
349 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
350 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
351 | CLANG_WARN_STRICT_PROTOTYPES = YES;
352 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
353 | CLANG_WARN_UNREACHABLE_CODE = YES;
354 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
355 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
356 | COPY_PHASE_STRIP = NO;
357 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
358 | ENABLE_NS_ASSERTIONS = NO;
359 | ENABLE_STRICT_OBJC_MSGSEND = YES;
360 | GCC_C_LANGUAGE_STANDARD = gnu99;
361 | GCC_NO_COMMON_BLOCKS = YES;
362 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
363 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
364 | GCC_WARN_UNDECLARED_SELECTOR = YES;
365 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
366 | GCC_WARN_UNUSED_FUNCTION = YES;
367 | GCC_WARN_UNUSED_VARIABLE = YES;
368 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
369 | MTL_ENABLE_DEBUG_INFO = NO;
370 | SDKROOT = iphoneos;
371 | TARGETED_DEVICE_FAMILY = "1,2";
372 | VALIDATE_PRODUCT = YES;
373 | };
374 | name = Profile;
375 | };
376 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
377 | isa = XCBuildConfiguration;
378 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
379 | buildSettings = {
380 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
381 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
382 | DEVELOPMENT_TEAM = S8QB4VV633;
383 | ENABLE_BITCODE = NO;
384 | FRAMEWORK_SEARCH_PATHS = (
385 | "$(inherited)",
386 | "$(PROJECT_DIR)/Flutter",
387 | );
388 | INFOPLIST_FILE = Runner/Info.plist;
389 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
390 | LIBRARY_SEARCH_PATHS = (
391 | "$(inherited)",
392 | "$(PROJECT_DIR)/Flutter",
393 | );
394 | PRODUCT_BUNDLE_IDENTIFIER = com.freshchat.flutterFreshchatExample;
395 | PRODUCT_NAME = "$(TARGET_NAME)";
396 | SWIFT_VERSION = 4.0;
397 | VERSIONING_SYSTEM = "apple-generic";
398 | };
399 | name = Profile;
400 | };
401 | 97C147031CF9000F007C117D /* Debug */ = {
402 | isa = XCBuildConfiguration;
403 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
404 | buildSettings = {
405 | ALWAYS_SEARCH_USER_PATHS = NO;
406 | CLANG_ANALYZER_NONNULL = YES;
407 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
408 | CLANG_CXX_LIBRARY = "libc++";
409 | CLANG_ENABLE_MODULES = YES;
410 | CLANG_ENABLE_OBJC_ARC = YES;
411 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
412 | CLANG_WARN_BOOL_CONVERSION = YES;
413 | CLANG_WARN_COMMA = YES;
414 | CLANG_WARN_CONSTANT_CONVERSION = YES;
415 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
416 | CLANG_WARN_EMPTY_BODY = YES;
417 | CLANG_WARN_ENUM_CONVERSION = YES;
418 | CLANG_WARN_INFINITE_RECURSION = YES;
419 | CLANG_WARN_INT_CONVERSION = YES;
420 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
421 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
422 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
423 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
424 | CLANG_WARN_STRICT_PROTOTYPES = YES;
425 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
426 | CLANG_WARN_UNREACHABLE_CODE = YES;
427 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
428 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
429 | COPY_PHASE_STRIP = NO;
430 | DEBUG_INFORMATION_FORMAT = dwarf;
431 | ENABLE_STRICT_OBJC_MSGSEND = YES;
432 | ENABLE_TESTABILITY = YES;
433 | GCC_C_LANGUAGE_STANDARD = gnu99;
434 | GCC_DYNAMIC_NO_PIC = NO;
435 | GCC_NO_COMMON_BLOCKS = YES;
436 | GCC_OPTIMIZATION_LEVEL = 0;
437 | GCC_PREPROCESSOR_DEFINITIONS = (
438 | "DEBUG=1",
439 | "$(inherited)",
440 | );
441 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
442 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
443 | GCC_WARN_UNDECLARED_SELECTOR = YES;
444 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
445 | GCC_WARN_UNUSED_FUNCTION = YES;
446 | GCC_WARN_UNUSED_VARIABLE = YES;
447 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
448 | MTL_ENABLE_DEBUG_INFO = YES;
449 | ONLY_ACTIVE_ARCH = YES;
450 | SDKROOT = iphoneos;
451 | TARGETED_DEVICE_FAMILY = "1,2";
452 | };
453 | name = Debug;
454 | };
455 | 97C147041CF9000F007C117D /* Release */ = {
456 | isa = XCBuildConfiguration;
457 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
458 | buildSettings = {
459 | ALWAYS_SEARCH_USER_PATHS = NO;
460 | CLANG_ANALYZER_NONNULL = YES;
461 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
462 | CLANG_CXX_LIBRARY = "libc++";
463 | CLANG_ENABLE_MODULES = YES;
464 | CLANG_ENABLE_OBJC_ARC = YES;
465 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
466 | CLANG_WARN_BOOL_CONVERSION = YES;
467 | CLANG_WARN_COMMA = YES;
468 | CLANG_WARN_CONSTANT_CONVERSION = YES;
469 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
470 | CLANG_WARN_EMPTY_BODY = YES;
471 | CLANG_WARN_ENUM_CONVERSION = YES;
472 | CLANG_WARN_INFINITE_RECURSION = YES;
473 | CLANG_WARN_INT_CONVERSION = YES;
474 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
475 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
476 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
477 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
478 | CLANG_WARN_STRICT_PROTOTYPES = YES;
479 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
480 | CLANG_WARN_UNREACHABLE_CODE = YES;
481 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
482 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
483 | COPY_PHASE_STRIP = NO;
484 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
485 | ENABLE_NS_ASSERTIONS = NO;
486 | ENABLE_STRICT_OBJC_MSGSEND = YES;
487 | GCC_C_LANGUAGE_STANDARD = gnu99;
488 | GCC_NO_COMMON_BLOCKS = YES;
489 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
490 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
491 | GCC_WARN_UNDECLARED_SELECTOR = YES;
492 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
493 | GCC_WARN_UNUSED_FUNCTION = YES;
494 | GCC_WARN_UNUSED_VARIABLE = YES;
495 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
496 | MTL_ENABLE_DEBUG_INFO = NO;
497 | SDKROOT = iphoneos;
498 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
499 | TARGETED_DEVICE_FAMILY = "1,2";
500 | VALIDATE_PRODUCT = YES;
501 | };
502 | name = Release;
503 | };
504 | 97C147061CF9000F007C117D /* Debug */ = {
505 | isa = XCBuildConfiguration;
506 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
507 | buildSettings = {
508 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
509 | CLANG_ENABLE_MODULES = YES;
510 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
511 | ENABLE_BITCODE = NO;
512 | FRAMEWORK_SEARCH_PATHS = (
513 | "$(inherited)",
514 | "$(PROJECT_DIR)/Flutter",
515 | );
516 | INFOPLIST_FILE = Runner/Info.plist;
517 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
518 | LIBRARY_SEARCH_PATHS = (
519 | "$(inherited)",
520 | "$(PROJECT_DIR)/Flutter",
521 | );
522 | PRODUCT_BUNDLE_IDENTIFIER = com.freshchat.flutterFreshchatExample;
523 | PRODUCT_NAME = "$(TARGET_NAME)";
524 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
525 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
526 | SWIFT_SWIFT3_OBJC_INFERENCE = On;
527 | SWIFT_VERSION = 4.0;
528 | VERSIONING_SYSTEM = "apple-generic";
529 | };
530 | name = Debug;
531 | };
532 | 97C147071CF9000F007C117D /* Release */ = {
533 | isa = XCBuildConfiguration;
534 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
535 | buildSettings = {
536 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
537 | CLANG_ENABLE_MODULES = YES;
538 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
539 | ENABLE_BITCODE = NO;
540 | FRAMEWORK_SEARCH_PATHS = (
541 | "$(inherited)",
542 | "$(PROJECT_DIR)/Flutter",
543 | );
544 | INFOPLIST_FILE = Runner/Info.plist;
545 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
546 | LIBRARY_SEARCH_PATHS = (
547 | "$(inherited)",
548 | "$(PROJECT_DIR)/Flutter",
549 | );
550 | PRODUCT_BUNDLE_IDENTIFIER = com.freshchat.flutterFreshchatExample;
551 | PRODUCT_NAME = "$(TARGET_NAME)";
552 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
553 | SWIFT_SWIFT3_OBJC_INFERENCE = On;
554 | SWIFT_VERSION = 4.0;
555 | VERSIONING_SYSTEM = "apple-generic";
556 | };
557 | name = Release;
558 | };
559 | /* End XCBuildConfiguration section */
560 |
561 | /* Begin XCConfigurationList section */
562 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
563 | isa = XCConfigurationList;
564 | buildConfigurations = (
565 | 97C147031CF9000F007C117D /* Debug */,
566 | 97C147041CF9000F007C117D /* Release */,
567 | 249021D3217E4FDB00AE95B9 /* Profile */,
568 | );
569 | defaultConfigurationIsVisible = 0;
570 | defaultConfigurationName = Release;
571 | };
572 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
573 | isa = XCConfigurationList;
574 | buildConfigurations = (
575 | 97C147061CF9000F007C117D /* Debug */,
576 | 97C147071CF9000F007C117D /* Release */,
577 | 249021D4217E4FDB00AE95B9 /* Profile */,
578 | );
579 | defaultConfigurationIsVisible = 0;
580 | defaultConfigurationName = Release;
581 | };
582 | /* End XCConfigurationList section */
583 | };
584 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
585 | }
586 |
--------------------------------------------------------------------------------