wahidnasri / flutter-mqtt-chat-client Goto Github PK
View Code? Open in Web Editor NEWA Chat app developed with Flutter, it uses MQTT protocol
License: GNU General Public License v3.0
A Chat app developed with Flutter, it uses MQTT protocol
License: GNU General Public License v3.0
hello, how to support voice messages
backend written in java, any plan add a go version for faster speed and easily deploy? (i'd like willing to have a try if there enough guidelines.
"InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag."
Has anyone encountered this error in flutter?
when app goes background ,it will sleep by android ssytem.
But when comes back to foreground, it will reconnects, but server didn't recognise it offline..
BTW, my app won't exist, but just back to home, so it not restart everytime.
Please check my powerful chatbot base on Python SDK:
Hi. I have made writen a chatbot based on this client possible!
And, it was really powerful and convenient to make a bot for anyone.
I am so happy to share the final version based on flutter-mqtt-chat-client, thanks for original ops wonderful job.
For future any body interested on this project:
Hi WahidNasri,
I can't find out how to register a user.
After building the app, here is the terminal output (sorry it seems a bit long)
$ flutter run ...
`๐ช Running with sound null safety ๐ช
An Observatory debugger and profiler on SM G991B is available at: http://127.0.0.1:54479/_RRjKnM55QU=/
The Flutter DevTools debugger and profiler on SM G991B is available at: http://127.0.0.1:54488?uri=http%3A%2F%2F127.0.0.1%3A54479%2F_RRjKnM55QU%3D%2F
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
V/InputMethodManager(12701): Starting input: tba=com.example.flutter_mqtt ic=io.flutter.plugin.editing.InputConnectionAdaptor@22a1f65 mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(12701): startInputInner - Id : 0
I/InputMethodManager(12701): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport(12701): Input channel constructed: 'ClientS', fd=116
D/InputTransport(12701): Input channel destroyed: 'ClientS', fd=109
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
V/InputMethodManager(12701): Starting input: tba=com.example.flutter_mqtt ic=io.flutter.plugin.editing.InputConnectionAdaptor@5efb8eb mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(12701): startInputInner - Id : 0
I/InputMethodManager(12701): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport(12701): Input channel constructed: 'ClientS', fd=115
D/InputTransport(12701): Input channel destroyed: 'ClientS', fd=116
W/IInputConnectionWrapper(12701): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(12701): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(12701): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(12701): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(12701): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(12701): getTextBeforeCursor on inactive InputConnection
E/SpannableStringBuilder(12701): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
E/SpannableStringBuilder(12701): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
E/SpannableStringBuilder(12701): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
E/SpannableStringBuilder(12701): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
D/InsetsSourceConsumer(12701): setRequestedVisible: visible=true, type=13, host=com.example.flutter_mqtt/com.example.flutter_mqtt.MainActivity, from=android.view.InsetsSourceConsumer.show:229 android.view.InsetsController.showDirectly:1437 android.view.InsetsController.controlAnimationUnchecked:1110 android.view.InsetsController.applyAnimation:1417 android.view.InsetsController.show:962 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6146 android.os.Handler.dispatchMessage:106 android.os.Looper.loop:246 android.app.ActivityThread.main:8595 java.lang.reflect.Method.invoke:-2
I/ViewRootImpl@ea15fdfMainActivity: MSG_RESIZED_REPORT: frame=(0,0,1080,2400) ci=(0,80,0,944) vi=(0,80,0,944) or=1
I/ViewRootImpl@ea15fdfMainActivity: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:10957 android.view.ViewRootImpl.access$1200:256 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6101
I/SurfaceControl(12701): nativeRelease nativeObject s[-5476376677826290144]
I/SurfaceControl(12701): nativeRelease nativeObject e[-5476376677826290144]
I/SurfaceControl(12701): assignNativeObject: nativeObject = 0 Surface(name=null)/@0x167b48a / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
I/SurfaceControl(12701): nativeRelease nativeObject s[-5476376677826253632]
I/SurfaceControl(12701): nativeRelease nativeObject e[-5476376677826253632]
I/SurfaceControl(12701): nativeRelease nativeObject s[-5476376677826290032]
I/SurfaceControl(12701): nativeRelease nativeObject e[-5476376677826290032]
I/SurfaceControl(12701): nativeRelease nativeObject s[-5476376677826249488]
I/SurfaceControl(12701): nativeRelease nativeObject e[-5476376677826249488]
I/ViewRootImpl@ea15fdfMainActivity: Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=16 res=0x1 s={true -5476376672993932736} ch=false fn=37
I/ViewRootImpl@ea15fdfMainActivity: [DP] pd() Asnyc report
W/libEGL (12701): EGLNativeWindowType 0xb400006e55f60a50 disconnect failed
I/ViewRootImpl@ea15fdfMainActivity: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4668 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938
I/ViewRootImpl@ea15fdfMainActivity: [DP] rdf()
I/SurfaceControl(12701): nativeRelease nativeObject s[-5476376677826287232]
I/SurfaceControl(12701): nativeRelease nativeObject e[-5476376677826287232]
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
V/InputMethodManager(12701): Starting input: tba=com.example.flutter_mqtt ic=io.flutter.plugin.editing.InputConnectionAdaptor@2dad660 mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(12701): startInputInner - Id : 0
I/InputMethodManager(12701): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport(12701): Input channel constructed: 'ClientS', fd=111
D/InputTransport(12701): Input channel destroyed: 'ClientS', fd=115
W/IInputConnectionWrapper(12701): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(12701): getTextBeforeCursor on inactive InputConnection
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt
D/InputMethodManager(12701): view is not EditText
D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity]
D/InputMethodManager(12701): getNavigationBarColor() -855310
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0
I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1
I/flutter (12701): 1-2021-09-23 13:29:13.403568 -- MqttClient::connect - keep alive is enabled with a value of 60 seconds
I/flutter (12701): 1-2021-09-23 13:29:13.407537 -- MqttConnectionKeepAlive:: Initialised with a keep alive value of 60 seconds
I/flutter (12701): 1-2021-09-23 13:29:13.407654 -- MqttConnectionKeepAlive:: Disconnect on no ping response is disabled
I/flutter (12701): 1-2021-09-23 13:29:13.409169 -- MqttConnectionHandlerBase::connect - server 172.16.14.99, port 1883
I/flutter (12701): 1-2021-09-23 13:29:13.411321 -- SynchronousMqttServerConnectionHandler::internalConnect entered
I/flutter (12701): 1-2021-09-23 13:29:13.411491 -- SynchronousMqttServerConnectionHandler::internalConnect - initiating connection try 0, auto reconnect in progress false
I/flutter (12701): 1-2021-09-23 13:29:13.411738 -- SynchronousMqttServerConnectionHandler::internalConnect - insecure TCP selected
I/flutter (12701): 1-2021-09-23 13:29:13.412121 -- SynchronousMqttServerConnectionHandler::internalConnect - calling connect
I/flutter (12701): 1-2021-09-23 13:29:13.412846 -- MqttNormalConnection::connect - entered`
Also I couldn't find the documentation, so I added the dependency into the same directory as this repository and apparently I can run the application, but in order to login, I must register, right?
hivemq-chat-extension-hivemq-1 | 2023-10-29 03:44:49,073 INFO - >>authorizePublish: Client ID = macos_f_client_6xgrZ | Topic = invitations/[email protected] | User ID = wahid1234
hivemq-chat-extension-hivemq-1 | 2023-10-29 03:44:49,424 INFO - MQTT 3.1.1 client connected with id: supreme_60ac289e-7040-480e-93a9-dc4e08e3cd4b
hivemq-chat-extension-hivemq-1 | 2023-10-29 03:44:49,604 INFO - >>authorizePublish: Client ID = supreme_60ac289e-7040-480e-93a9-dc4e08e3cd4b | Topic = personalevents/wahid1234 | User ID = null
hivemq-chat-extension-hivemq-1 | 2023-10-29 03:44:49,671 INFO - AUTHORIZED
hivemq-chat-extension-hivemq-1 | 2023-10-29 03:44:49,678 INFO - Client disconnected with id: supreme_60ac289e-7040-480e-93a9-dc4e08e3cd4b
hivemq-chat-extension-hivemq-1 | 2023-10-29 03:44:49,679 INFO - AUTHORIZED
its showing on hive, but i cant see it inside the application.
Just for anyone also interested in this project, I believe op gets a very impressive implementationon mqtt chatter. But after I tried the default Java backend, it was messy to be honest, So i re-written it into Golang, now
It looks great, everything works fine. So that mine and share a same client with ops, but with different backend.
Here is some screen shot of mine:
The enhancement based on this version, I did:
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: FormatException: Unexpected character (at character 2)
{id: e74d8c82-626c-419b-b393-ab6bddcb093e, presenceType: Away, type: Presen...
^
#0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1405:5)
#1 _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:935:48)
#2 _parseJson (dart:convert-patch/convert_patch.dart:40:10)
#3 JsonDecoder.convert (dart:convert/json.dart:506:36)
#4 JsonCodec.decode (dart:convert/json.dart:157:41)
#5 jsonDecode (dart:convert/json.dart:96:10)
#6 new MqttOnlineReader.<anonymous closure> (package:flutter_mqtt/MqttImpl/MqttOnlineReader.dart:31:41)
#7 _rootRunUnary (dart:async/zone.dart:1436:47)
#8 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#9 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#10 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#11 _DelayedData.perform (dart:async/stream_impl.dart:591:14)
#12 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
#13 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7)
#14 _rootRun (dart:async/zone.dart:1420:47)
#15 _CustomZone.run (dart:async/zone.dart:1328:19)
#16 _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#17 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
#18 _rootRun (dart:async/zone.dart:1428:13)
#19 _CustomZone.run (dart:async/zone.dart:1328:19)
#20 _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#21 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
#22 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#23 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
when sending image
hi๏ผ how about add mainflux backbone support as well?
Hi, how to make new messages coming can have a red dots at session page?
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.