talkjs / talkjs-flutter Goto Github PK
View Code? Open in Web Editor NEWFlutter SDK for the TalkJS Chat API
Home Page: https://talkjs.com
License: BSD 3-Clause "New" or "Revised" License
Flutter SDK for the TalkJS Chat API
Home Page: https://talkjs.com
License: BSD 3-Clause "New" or "Revised" License
The property ChatBox.messageField.enterSendsMessage
does not work. When I tap the return button (on iOS or Android) the message is being sent. Here the code I'm using to build the chatbox:
ChatBox(
session: _session,
conversation: _conversation,
showChatHeader: false,
messageField: MessageFieldOptions(
spellcheck: true,
enterSendsMessage: false, // <-- always set to false
),
theme: Theme.of(context).brightness == Brightness.light ? 'default' : 'default-dark',
)
I could be a wrong mapping of the "return" button on mobile platforms? In JS SDK is everything ok.
Hey,
I use firebase core and firebase messaging in my app. It works fine in Android but there is an error in iOS:
PlatformException(channel-error, unable to establish connection on channel., null, null)
After some research I found that problem is in outdated versions and every solution included update of them.
I have the latest versions:
firebase_core: ^2.13.0
firebase_messaging: ^14.6.1
However your versions are different. When I removed your package, the error gone.
Could you please update versions of firebase_core and firebase_messaging to the latest? I hope it will help me.
Thank you.
I have been battling with this issue for days. There seems to be no way to end the current session so a user can start another session. The use case here is logging out. Once I log out, I want to be able to login back with my previous credential or a new one with a new talkjs session. Each time i try that i get a 'The me property has already been set for the Session object'. I have tried disposing the session, but I still cannot create a new session with a new .me property. Below is a snapshot of the code and error
Flutter 3.10
talkjs_flutter 0.8.1
Do you have a plan to support Windows platform for this Flutter SDK?
Hey,
I integrated firebase core and firebase messaging in my app. It works fine in Android but there is an error in iOS:
PlatformException(channel-error, unable to establish connection on channel., null, null)
After removing packages one by one, i discovered removal of talkjs_flutter solved the issue.
I am using the latest firebase_core: 2.14.0 and firebase_messaging: 14.6.3 with talkjs_flutter: 0.8.1
We are using the TalksJs-Flutter plugin in our project to do the livechat for customer service.
With the current version of the plugin when tapping a link in the chat the link is opened inside the webview from te plugin. We do not want our links to open inside our app but want to open show a popup telling the customer that they are leaving the app and then open the link in the browser.
We would like to have a navigationDelegate parameter on the ChatBox which passes the NavigationDelegate to the webview for handling links
Example solution:
class ChatBox extends StatefulWidget {
final Session session;
final TextDirection? dir;
final MessageFieldOptions? messageField;
final bool? showChatHeader;
final TranslationToggle? showTranslationToggle;
final String? theme;
final TranslateConversations? translateConversations;
final List<String> highlightedWords = const <String>[];
final MessagePredicate messageFilter;
final Conversation? conversation;
final bool? asGuest;
final SendMessageHandler? onSendMessage;
final TranslationToggledHandler? onTranslationToggled;
final LoadingStateHandler? onLoadingStateChanged;
final Map<String, MessageActionHandler>? onCustomMessageAction;
final NavigationDelegate? navigationDelegate; // <--- ADD HERE
const ChatBox({
Key? key,
required this.session,
this.dir,
this.messageField,
this.showChatHeader,
this.showTranslationToggle,
this.theme,
this.translateConversations,
//this.highlightedWords = const <String>[], // Commented out due to bug #1953
this.messageFilter = const MessagePredicate(),
this.conversation,
this.asGuest,
this.onSendMessage,
this.onTranslationToggled,
this.onLoadingStateChanged,
this.onCustomMessageAction,
this.navigationDelegate, // <--- ADD HERE
}) : super(key: key);
@override
State<ChatBox> createState() => ChatBoxState();
}
return WebView(
initialUrl: 'about:blank',
javascriptMode: JavascriptMode.unrestricted,
debuggingEnabled: kDebugMode,
onWebViewCreated: _webViewCreatedCallback,
onPageFinished: _onPageFinished,
javascriptChannels: <JavascriptChannel>{
JavascriptChannel(
name: 'JSCSendMessage', onMessageReceived: _jscSendMessage),
JavascriptChannel(
name: 'JSCTranslationToggled',
onMessageReceived: _jscTranslationToggled),
JavascriptChannel(
name: 'JSCLoadingState', onMessageReceived: _jscLoadingState),
JavascriptChannel(
name: 'JSCCustomMessageAction',
onMessageReceived: _jscCustomMessageAction),
},
gestureRecognizers: {
// We need only the VerticalDragGestureRecognizer in order to be able to scroll through the messages
Factory(() => VerticalDragGestureRecognizer()),
},
navigationDelegate: widget.navigationDelegate, // <--- ADD HERE
);
Hi,
thank you for the project!
I need firebase cloud messaging to get notifications in background.
But it didn't work because of needed settings by talkjs-flutter project
flutter_apns.disable_swizzling: true
If I remove it, there is a problem
Firebase PlatformException(channel-error, unable to establish connection on channel., null, null)
It breaks the key feature in my application.
Please, help me to fix it. It's really urgent.
Thank you!
Hello!
I have problem with "too many" push notifications I shouldn't receive.
I am testing on Android 12 and 13.
Case:
Additionally all the push notifications messages are combined like they are sent from another user even if it's me.
Can any1 check this behavior or tell me how can I really kill the previous session?
Thank you!
Is there a way to add/remove a partecipant or change its permission?
In JS SDK I see this conversation.setParticipant(me);
but not found anything in Dart SDK
Ref: https://talkjs.com/docs/Features/Group_Chats/Access_rights/
When I upgrade talkjs_flutter sdk version to 0.10.0 from 0.2.1 I get this error :
Because talkjs_flutter >=0.9.0 depends on http ^0.13.6 and mlc_concierge depends on http ^1.1.2, talkjs_flutter >=0.9.0 is forbidden.
So, because mlc_concierge depends on talkjs_flutter ^0.10.0, version solving failed.
I can't downgrade my version of http because of other dependencies.
After instilling talkjs lib, Firebase lib starts throwing this error on Firebase.initializeApp:
PlatformException(channel-error, Unable to establish connection on channel., null, null)
Here dependencies from my pubspec.yaml:
firebase_core: ^2.3.0
talkjs_flutter: ^0.6.0
Hello talkjs team!
I am working on an application and I have faced to some problems:
themeData
brightness: Brightness.dark
doesn't help with the situation. I need to be able to change keyboard color to Brightness.dark.Could you please help me and fix it as soon as possible?
Here is a video of the problem.
https://user-images.githubusercontent.com/24383434/214597541-e6ec7b2c-3850-453b-8b9c-33df5c3f1143.mp4
And part of my code (build):
Widget build(BuildContext context) {
final themeData = Theme.of(context);
return Scaffold(
appBar: AppBar(
// title: Text(conversation?.subject ?? ''),
),
body: Container(
padding: const EdgeInsets.only(bottom: 20),
color: themeData.scaffoldBackgroundColor,
child: FutureBuilder(
future: getChatBasicInfo(),
builder: (_, snapshot) {
if (!snapshot.hasData || session == null) {
return Container();
}
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) => Column(
children: <Widget>[
Visibility(
visible: !_chatBoxLoaded,
child: SizedBox(
width: min(constraints.maxWidth, constraints.maxHeight),
height: min(constraints.maxWidth, constraints.maxHeight),
child: Center(
child: SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(
color: themeData.primaryColor,
strokeWidth: 2,
),
),
),
),
),
Visibility(
maintainState: true,
visible: _chatBoxLoaded,
child: ConstrainedBox(
constraints: constraints,
child: ChatBox(
session: session!,
conversation: conversation,
theme: 'dark_theme',
onLoadingStateChanged: (state) {
setState(() {
_chatBoxLoaded = state == LoadingState.loaded;
});
},
messageField: const MessageFieldOptions(
enterSendsMessage: true,
),
showChatHeader: false,
),
),
),
],
),
);
},
),
),
);
}
Hello!
I have problem with push notifications on Android while app is killed.
I do have Firebase push notifications in my app which are working fine. While sending push from Firebase console I am receiving it no matter if the app is in foreground, background or killed.
Push notification from talkJs are showing only while the app is in foreground or background.
No chat notifications are received while app is killed. This behavior appy only to Android (iOS is seems to be working).
Looking for help or confirmation that pushes from talkJs chat are working on Android while the app is terminated.
Thank you!
Hello!
I have problem with push notifications on clean installation of my app.
I am testing on Android 12 and 13.
Case:
When I open my view where I return ChatBox with session and conversation then the push notifications are showing.
After that I can close and kill the app and next time I run it, it is working fine.
It looks like a bug on a "first run".
Can any1 check this behavior?
Thank you!
i am using talkjs_flutter: ^0.2.1 and in iphone i am getting extra white space above Say something text field, Please fix it ASAP(Same is working fine in android
)
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.