Giter VIP home page Giter VIP logo

livechat's Introduction

💬 livechat

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

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

🎖 Installing

dependencies:
  livechatt: "^1.4.0"

⚡️ Import

import 'package:livechatt/livechatt.dart';

🎮 How To Use

Get the Crendentials for your LiveChat

Android

  • Edit AndroidManifest.xml as shown below

Internet and Storage Access

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

ChatWindow

<activity android:name="com.livechatinc.inappchat.ChatWindowActivity" android:configChanges="orientation|screenSize" />

iOS - Manifest

  • Set minimum deployment target of iOS to 11.0
  • Edit info.plist as shown below

Sending Files From Device Library

<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app require access to the microphone.</string>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera.</string>

Having issues running on ios?

Add the below to your podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
    end
  end
end

Dart Usage

  • Regular usage
onPressed: (){
    Livechat.beginChat(LICENSE_NO, GROUP_ID, VISITOR_NAME, VISITOR_EMAIL);
    },
  • Cases where there are custom parameters
var cmap = <String, String>{
    'org': 'organizationTextController.text',
    'position': 'positionTextController.text'
  };

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

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

Views

🐛 Bugs/Requests

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

❗️ Note

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

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

🤓 Developer(s)

Abada Samuel Oghenero

⭐️ License

livechat's People

Contributors

imgbotapp avatar mastersam07 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

livechat's Issues

Support customParamsMap

Hi,
I have an issue related pass parameter to LiveChat SDK.
And I have a solution for it. Would u like to I create Pull request for this issue ?

Thanks u

Live chat showing the "Couldn't load chat" when running application in Flutter android

I have tried to implement Livechat using this documentation but when I try to start the live chat its showing below error,

`onConsoleMessageERROR Uncaught (in promise) Error: An error occurred. See https://github.com/styled-components/polished/blob/master/src/internalHelpers/errors.md#3 for more information.

I/chromium(17902): [INFO:CONSOLE(2)] "Uncaught (in promise) Error: An error occurred. See https://github.com/styled-components/polished/blob/master/src/internalHelpers/errors.md#3 for more information.", source: https://cdn.livechatinc.com/widget/static/js/1.814b9876.chunk.js (2)`

Flutter version:
Flutter 3.10.1 • channel stable • https://github.com/flutter/flutter.git
Tools • Dart 3.0.1 • DevTools 2.23.1

Android:
minSdkVersion 21
targetSdkVersion 33

Does any one have idea? what I am doing wrong here?

Screenshot_1686829947

Not work in iOS

Dear,

I have LiveChat working on Android, but it doesn't work on iOS. When clicking the button to open LiveChat, the application closes.

Flutter: 2.10.3
LiveChat: 1.4.0

All info.pList and Podfile settings have been done.

Best Regards

Livechat.beginChat() method crashes the app

Hi @Mastersam07,

I am in the middle of upgrade livechatt package to v1.4.0 and I have first upgraded the flutter app minimum iOS target as 11.0, and the app is working fine. Then I have upgraded the livechatt to v1.4.0 then also the app is running fine except, calling the Livechat.beginChat(...) causes the app to get crashed (even the debug app is disconnecting)

Breakpoint hits below statement and the values are valid as before when working with older versions.
Livechat.beginChat(LICENSE_NO, GROUP_ID, VISITOR_NAME, VISITOR_EMAIL);

All arguments have values and nothing is null.

Below is the only error (info) I get in developer console.
Could not cast value of type 'NSNull' (0x....) to 'NSDictionary' (0x.....).

Can you help me to resolve this issue?

Thanks!

loads slowly

sorry please can you make the load time before the chat details collection ui display bit faster......
it shows circular loading indicators for some seconds

iOS Pod Install issue

When compiling the example for this plugin, I get the following error from the pod install and the build fails.

Downloading dependencies

    -> Installing Flutter (1.0.0)

    -> Installing LiveChat (2.0.20)
      > Copying LiveChat from
      `/Users/bobcoenradi/Library/Caches/CocoaPods/Pods/Release/LiveChat/2.0.20-
      27dae` to `Pods/LiveChat`

    -> Installing livechat (1.0.0+1)
      - Running pre install hooks
    [!] The 'Pods-Runner' target has frameworks with conflicting names:
    livechat.

How to remove email?

Hello, i want to remove email from this plugin. Is it possible to remove everything that related to email including UI?
Thanks.

Stuck on white screen when minimising chat window

I have not tested this on Android yet, but when running on iOS simulator / iOS device I seem to be unable to exit the chat window properly.

When I tap the minimise button in the top right corner, a white screen is displayed and I can not go back by any means.
Hot restarting does not help.

Only way to return to app is to kill the app and restart.

Could not cast value of type 'NSNull' (0x1da9e7200) to 'NSDictionary'


Translated Report (Full Report Below)

Incident Identifier: FB33331A-FCDA-4A36-BCB8-44EB539EE5CF
CrashReporter Key: BECEEB1E-0D1C-8B3E-D352-ECBDD0F47368
Hardware Model: MacBookPro18,3
Process: Runner [52925]
Path: /Users/USER/Library/Developer/CoreSimulator/Devices/89F15741-8116-4B3B-8C8F-D2A59E53E1A1/data/Containers/Bundle/Application/B78EA271-4E11-4568-A11C-F4ABEBD5D42E/Runner.app/Runner
Identifier: com.eterex
Version: 1.0.3 (5)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd_sim [4258]
Coalition: com.apple.CoreSimulator.SimDevice.89F15741-8116-4B3B-8C8F-D2A59E53E1A1 [1280]
Responsible Process: SimulatorTrampoline [3172]

Date/Time: 2022-07-11 18:05:18.0163 +0430
Launch Time: 2022-07-11 18:04:54.8091 +0430
OS Version: macOS 12.2.1 (21D62)
Release Type: User
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0

Application Specific Information:
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
CoreSimulator 802.6 - Device: iPhone12 (89F15741-8116-4B3B-8C8F-D2A59E53E1A1) - Runtime: iOS 15.4 (19E240) - DeviceType: iPhone 12
Could not cast value of type 'NSNull' (0x1da9e7200) to 'NSDictionary' (0x1da9e6da8).
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
abort() called

Feature Request: Chat bubble

Hi @Mastersam07 and @ImgBotApp,
In LiveChat there is a feature to enable from their console to show a chat bubble button as shown in the image.
image

At the moment your flutter plugin doesn't have a feature as such but the author has given that feature exposed and as they only support for native platforms, they are available for native platforms only.

This link shows native implementation for chat bubble.
https://developers.livechat.com/docs/getting-started/installing-livechat/android-widget/#sample-application

Would you guys be able to enable that chat bubble feature in flutter plugin as well? Thank you!

Deprecation of v3.1 in LiveChat APIs and SDKs

Hi @Mastersam07,

Hope you received this same email from LiveChat about their upcoming upgrade. My app is using your livechatt flutter package, hence I would like if the package keeps aligned with these upgrades without causing issues.

Quoted from email;

... reaching out to inform you that we’ll drop support of v3.1 in LiveChat APIs and SDKs at the end of March 2022. The change concerns the following services:
the Agent Chat API
the Customer Chat API
the Configuration API
LiveChat JavaScript SDK
LiveChat Go SDK

Make sure to migrate your application to the current stable API version by 31-03-2022.

Thanks!

NullPointer exception on beginChat

Followed the installation for Android. When i try to start the chat I get a nullpointer exception.

<activity android:name="com.livechatinc.inappchat.ChatWindowActivity" android:configChanges="orientation|screenSize" /> Is in the manifest

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
E/MethodChannel#livechat( 7569): 	at android.content.ComponentName.<init>(ComponentName.java:131)
E/MethodChannel#livechat( 7569): 	at android.content.Intent.<init>(Intent.java:6510)
E/MethodChannel#livechat( 7569): 	at tech.mastersam.livechat.LivechatPlugin.onMethodCall(LivechatPlugin.java:82)
E/MethodChannel#livechat( 7569): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:230)
E/MethodChannel#livechat( 7569): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#livechat( 7569): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
E/MethodChannel#livechat( 7569): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#livechat( 7569): 	at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#livechat( 7569): 	at android.os.Looper.loop(Looper.java:174)
E/MethodChannel#livechat( 7569): 	at android.app.ActivityThread.main(ActivityThread.java:7356)
E/MethodChannel#livechat( 7569): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#livechat( 7569): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/MethodChannel#livechat( 7569): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/flutter ( 7569): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference, null) 

help

I got this error today [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method beginChat on channel livechat)
E/flutter ( 6132): #0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:159
E/flutter ( 6132):
E/flutter ( 6132): #1 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:334
E/flutter ( 6132): #2 Livechat.beginChat (package:livechat/livechat.dart:17:20)
E/flutter ( 6132): #3 _MyHomePageState.build.

Constructed URL response always shows Connection Lost

Hello @Mastersam07 Developers please help me to get out of this issue
When i'm using this package after login in livechat.com it shows always Connection lost i'm adding this video please tell me if you need other information Please reply ASAP it's very urgent task for me

104300-360x780.mp4

package minimizes app in certain conditions

Hello there!
So, I've been using livechatt package for some time, and, recently, I've found a bug that is kind of annoying in it.
The thing is, whenever the user is using the app, and if it, by any case, open livechatt and minimizes it, it'll minimize the app forever.
The user can't go back to the app if it's not "killed" i.e, closed. I've tried many times clicking on the minus (-) button that appears at the top left corner of the livechatt app screen, but it just minimizes the whole app, not only livechatt.

Only works on simulator

Hi - I added the package to my flutter app and it works perfectly in dev mode on android simulator, iOS simulator and also with a real iOS device in dev mode.

As soon as I build a release it doesn't work anymore. No chat appears.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.