chatwoot / chatwoot-flutter-sdk Goto Github PK
View Code? Open in Web Editor NEWChatwoot Flutter SDK
License: MIT License
Chatwoot Flutter SDK
License: MIT License
While building chatwoot-flutter-sdk is a longer project, I think you could achieve great immediate results by creating a simple webview package that would simply load the chatwoot widget into a full screen webview inside of a flutter app.
That's the approach widely done by other chats. At a very basic level it would be just doing launch('https://app.chatwoot.com/widget?website_token=....
however it would be great to actually build up the similar html inside of the flutter app so that you are able to set the user identity, i.e you'd call a widget:
ChatwootWebView(
url='https://app.chatwoot.com/widget',
websiteToken='..... ',
userName: ...
userEmail: ..
userAvatarUrl: ....
identifierHash: ...
This is much less work and would make chatwoot immediately available to the flutter community with the same production quality of the widget as you have now (i.e. avoid lengthy testing/improvement cycle you'd have building a whole new sdk / ui widgets)
@EphraimNetWorks is this something you could consider looking at?
Are there any plans / work done on building a flutter chat client?
Great job @EphraimNetWorks!
I am trying to see if we can use this for our project - do you support multiple conversations?
I could not find it in the code.
Todo:
Is there a way to get messages in the background to notify the user that there is a pending message?
Hi,
Anyone using Chatwoot Flutter SDK ?
I am facing issue in chat history persistence even though I am passing "IdentifierHash" Properly.
The chat history is only available for single device, but if same user login with different device than chat history is not available and new fresh conversation is being created for the same user in chatwoot agent dashboard.
If anyone have any idea on this please help.
Thanks
The Readme is missing the documentation for developing the SDK.
flutter chat UI already has components prepared for it. Is it planned to implement those?
I have integrated flutter sdk webview with our app and it worked fine but sometimes messages from chatwoot server side is inconsistent.
We need to go back and come again on chat window to see the messages. the messages are not coming in real time. this issue is random and we are sometimes not able to re-generate the same issue.
please help me understand why it is happening and what solution we can do for this.
this issue is lesser known in android devices but frequent in iOS device.
Another great approach would be to use openapi standard (preferably generated) to describe the api endpoints that later on can be used to generate a dart client (or js or python or java) with openapi-generator
Thats saves a lot of time developing clients - all the api endpoints and models are generated for you.
Instead of rebuilding the api for each client, you could auto-generate it, it would speed up a lot building something like
We are not able to add phone_number to ChatwootUser
ChatwootUser(
identifier: "[email protected]",
name: "John Samuel",
email: "[email protected]",
)
Hi,
I am trying to upload some files like image, pdf and videos from chatwoot self hosted server and able to upload but I am not able to access those file in flutter webview sdk. Only image is visible in flutter webview sdk and that also coming too large when clicking
Please help if you know where to change this file type support.
@sojan-official @pranavrajs
This library has not been updated for a long time.
There are a lot of compatibility issues right now, look forward to update.
Hello Team,
I am having some difficulties with integrating ChatWoot, I'm using Flutter SDK for integration, but when I installed I realized
that ChatWoot SDK still uses old dependencies, such as INTL 0.0.9, but FLutterFlow uses 0.17.0, is it possible to update the INTL library for Flutter SDK to 0.17.0 INTL version? See screenshots from the errors that I received from Flutterflow during installation packages.
chatwoot version: ^0.0.9
Rendering the ChatwootChat widget in flutter app results in the following error being shown when building for iOS simulator.
Error (Xcode): ../../.pub-cache/hosted/pub.dev/photo_view-0.12.0/lib/src/core/photo_view_gesture_detector.dart:89:38: Error: No named parameter with the name 'kind'.
I wan to Know how to implement interactive messaging and how it works with flutter app
Messages sent from the Chatwoot web app it is not receiving in SDK. You can see these 3 issues in this screencast.
https://www.loom.com/share/bc062896d0e44598b5dd031fbd5a995b
I'm trying to get this SDK running on my app that already uses HIve as local DB, but seem to be getting an error when persistence is enabled(which I guess uses HIve internally too to store chat history). Is there an issue with the Hive implementation in the package internally that fails when used in combination with app that already. has hive implemented. Attaching error code below.
Can anyone guide me on further steps?
HiveError: Cannot write, unknown type: ChatwootUser. Did you forget to register an adapter?
Hi,
I have been trying to enforce user identity validation in chatwoot SDK but getting this exception -
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Instance of 'ChatwootClientException'
E/flutter (13424): #0 ChatwootClientAuthServiceImpl.createNewContact (package:chatwoot_client_sdk/data/remote/service/chatwoot_client_auth_service.dart:52:7)
E/flutter (13424):
E/flutter (13424): #1 ChatwootClientApiInterceptor.onRequest. (package:chatwoot_client_sdk/data/remote/service/chatwoot_client_api_interceptor.dart:37:19)
E/flutter (13424):
E/flutter (13424): #2 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter (13424):
E/flutter (13424): #3 ChatwootClientApiInterceptor.onRequest (package:chatwoot_client_sdk/data/remote/service/chatwoot_client_api_interceptor.dart:29:5)
E/flutter (13424):
When I dig deeper in the exception, I realized that this exception is caused when createNewContact function is trying to Create Contact using createContactAPI in chatwoot_client_auth_service.dart file. the Exception is -
DioError [DioErrorType.response]: Http status error [500]
this exception came because createConatctAPI expects "identifier_hash" attribute but SDK pass "identifierHash" attribute instead.
since the ChatwootUser function is written this way -
ChatwootUser(
{this.identifier,
this.identifierHash,
this.name,
this.email,
this.avatarUrl,
this.customAttributes});
and client ContactsAPI expects payload in this format -
{
"identifier": "string",
"identifier_hash": "string",
"email": "string",
"name": "string",
"phone_number": "string",
"avatar_url": "string",
"custom_attributes": { }
}
What should I do in this case.?
I am attaching postman screenshots also to describe the issue clearly
We need to have updated SDK that uses intl 0.18.1 and flutter 3.13.9. We are waiting with 5+ projects ready to implement, please help.
If ChatwootChatDialog.show
is called the conversation and contact API is getting called two-plus times, So same conversation is created multiple times.
I have tried enabling CSAT for a certain inbox.
But I did not get any survey after resolving the conversation.
is CSAT supported on flutter or is it still on the road-map, or will it be skipped for flutter ?
Sending messages from SDK is not working, it's showing a loading spinner.
https://user-images.githubusercontent.com/64252451/164619564-e05aa5c9-35ec-4813-8c72-ca74dc59f65e.mov
Is there any way Chatwoot supports the push notification?
As current chatwoot_sdk 0.0.9 doesn't have latest build and not able to find ChatwootWidget.
My app use the dio version ^5.1.1 the latest one.
But chatwoot depends on dio ^4.0.0 wich is an older version, the first of Null Safete.
Why don't upgrade the dio version so it matches with the new apps that are being developed?
Is there a way to automatically send a greeting message with some info when the user first opens the chat window?
Hey guys, so I have followed your instructions from: https://github.com/chatwoot/chatwoot-flutter-sdk#b-using-chatwootchat-widget
I can set the user, but the messages are not sending through. Am I missing something here?
Using the ChatwootChat
without a ChatwootUser
or a ChatwootUser
without an email is currently impossible, despite user
being nullable.
======== Exception caught by Flutter framework =====================================================
The following _CastError was thrown:
type 'Null' is not a subtype of type 'String' in type cast
When the exception was thrown, this was the stack:
#0 _$ChatwootContactFromJson (package:chatwoot_sdk/data/local/entity/chatwoot_contact.g.dart:65:26)
#1 new ChatwootContact.fromJson (package:chatwoot_sdk/data/local/entity/chatwoot_contact.dart:46:7)
#2 ChatwootClientAuthServiceImpl.createNewContact (package:chatwoot_sdk/data/remote/service/chatwoot_client_auth_service.dart:40:41)
<asynchronous suspension>
#3 ChatwootClientApiInterceptor.onRequest.<anonymous closure> (package:chatwoot_sdk/data/remote/service/chatwoot_client_api_interceptor.dart:37:19)
<asynchronous suspension>
#4 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
<asynchronous suspension>
#5 ChatwootClientApiInterceptor.onRequest (package:chatwoot_sdk/data/remote/service/chatwoot_client_api_interceptor.dart:29:5)
<asynchronous suspension>
I/flutter (18358): #5 ChatwootClientApiInterceptor.onRequest (package:chatwoot_sdk/data/remote/service/chatwoot_client_api_interceptor.dart:29:5)
====================================================================================================
======== Exception caught by Flutter framework =====================================================
The following _CastError was thrown:
type 'Null' is not a subtype of type 'String' in type cast
When the exception was thrown, this was the stack:
#0 _$ChatwootContactFromJson (package:chatwoot_sdk/data/local/entity/chatwoot_contact.g.dart:65:26)
#1 new ChatwootContact.fromJson (package:chatwoot_sdk/data/local/entity/chatwoot_contact.dart:46:7)
#2 ChatwootClientAuthServiceImpl.createNewContact (package:chatwoot_sdk/data/remote/service/chatwoot_client_auth_service.dart:40:41)
<asynchronous suspension>
#3 ChatwootClientApiInterceptor.onRequest.<anonymous closure> (package:chatwoot_sdk/data/remote/service/chatwoot_client_api_interceptor.dart:37:19)
<asynchronous suspension>
#4 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
<asynchronous suspension>
#5 ChatwootClientApiInterceptor.onRequest (package:chatwoot_sdk/data/remote/service/chatwoot_client_api_interceptor.dart:29:5)
<asynchronous suspension>
====================================================================================================
Hey! I have been using Chatwoot with no issue in my web page. Recently, I have developed a mobile app using flutter. It seems like there is an issue with Chatwoot on it. When testing it out, I am unable to send any messages.
It just loads on forever.
Schreenshot:
This is how I Implemented in on the mobile app
Chatwoot Button (clicking this will open the chatwoot box):
Widget build(BuildContext context) {
return Container(
height: 55,
width: 55,
margin: EdgeInsets.only(bottom: isNavAvailable ? 50 : 0),
decoration: const BoxDecoration(
color: colorChatwoot,
shape: BoxShape.circle,
),
child: InkWell(
customBorder: const CircleBorder(),
onTap: onTap,
child: Icon(
show ? Icons.close : Icons.chat_bubble_rounded,
color: colorChatwoot.computeLuminance() < 0.5
? Colors.white
: Colors.black,
size: 25,
),
),
);
}
Chatwoot box:
final AppLocalizations _local = AppLocalizations.of(context)!;
MediaQueryData queryData = MediaQuery.of(context);
double _marginBottom = isNavAvailable
? queryData.size.width * 0.30
: queryData.size.width * 0.18;
if (queryData.size.width > 400) {
_marginBottom = isNavAvailable
? queryData.size.width * 0.34
: queryData.size.width * 0.24;
}
return Container(
width: double.infinity,
alignment: Alignment.bottomRight,
margin: EdgeInsets.only(bottom: _marginBottom, top: 10),
child: Visibility(
visible: show,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
blurRadius: 10,
color: Theme.of(context).shadowColor.withOpacity(0.2),
),
],
),
constraints: BoxConstraints(
minWidth: 100,
maxWidth: 380,
minHeight: 100,
maxHeight: queryData.size.width * 1.3,
),
margin: const EdgeInsets.all(20),
child: ClipRRect(
borderRadius: BorderRadius.circular(15),
child: ChatwootChat(
baseUrl:
"our websocket url,
inboxIdentifier: "our inbox identifier",
user: ChatwootUser(
identifier: email,
name: name,
email: email,
),
),
),
),
),
);
}
Did i implement this wrong? Any help would be great! Thank you so much
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.