Why HMS Push Kit onBackgroundRemoteMessageReceived() not triggering in background.js file - ionic-framework

My Ionic capacitor is set as per these instructions. It is able to receive data messages just fine when the app is in the background or foreground. But the background.js script is not being called when the app is killed.
this.hmsPush.setBackgroundFile("public/assets/background.js")
background.js
var data = {
"key":"value"
};
onGetItemResponse((result)=>{
console.log(JSON.stringify(result));
});
onBackgroundRemoteMessageReceived((remoteMessage)=>{
const jsonData = JSON.parse(remoteMessage.data);
const headlessNotification = {
"title": "[Headless] " + jsonData.title,
"message": jsonData.message.replace("{{name}}","YourName")
};
const notification = JSON.stringify(headlessNotification);
HmsLocalNotification.backgroundLocalNotification(notification);
});
HmsPush.setItem("test",JSON.stringify(data));
HmsPush.getItem("test");
HmsPush.removeItem("test");
Update 1
Here is the log when I try to send and data message and the app is already killed.
This line is suspicious
04-25 10:20:01.809 W/ActivityManager( 1461): Service starting has been prevented by iaware or trustsbase sInfo ServiceInfo{8882f89 com.huawei.hms.cordova.push.remote.HmsPushMessageService}
04-25 10:20:01.776 I/PushLog110105309( 5138): [SocketRead_09:20:20-233]enter cancelAlarm(Action=com.huawei.android.push.intent.RESPONSE_FAIL
04-25 10:20:01.778 I/PushLog110105309( 5138): [SocketRead_09:20:20-233]process cmdid to receive from pushSrv:44, subCmdId:FF
04-25 10:20:01.783 I/PushLog110105309( 5138): [SocketRead_09:20:20-233]dispatchIntent over
04-25 10:20:01.785 I/PushLog110105309( 5138): [ReceiverDispatcher-209]process push message cmdid from pushSrv:44, subCmdId:FF
04-25 10:20:01.796 I/PushLog110105309( 5138): [ReceiverDispatcher-209]msgType:3 [0:PassBy msg, 1:System notification, 2:normal notification, 3:HCM PassBy msg],userId:0
04-25 10:20:01.799 I/PushLog110105309( 5138): [ReceiverDispatcher-209] closeTokenCheck: false
04-25 10:20:01.802 I/PushLog110105309( 5138): [ReceiverDispatcher-209]app declare HmsMessageService num is: 1
04-25 10:20:01.802 I/PushLog110105309( 5138): [ReceiverDispatcher-209]judge process is running start
04-25 10:20:01.805 I/PushLog110105309( 5138): [ReceiverDispatcher-209]no running process.
04-25 10:20:01.805 W/PushLog110105309( 5138): [ReceiverDispatcher-209]process com.**** not exist and control 0
04-25 10:20:01.805 I/PushLog110105309( 5138): [ReceiverDispatcher-209]tempDozeWhileListTime = 10000
04-25 10:20:01.805 I/PushLog110105309( 5138): [ReceiverDispatcher-209]add com.**** to doze temp white list
04-25 10:20:01.807 I/PushLog110105309( 5138): [ReceiverDispatcher-209]do not need to apply net.
04-25 10:20:01.809 W/ActivityManager( 1461): Service starting has been prevented by iaware or trustsbase sInfo ServiceInfo{8882f89 com.huawei.hms.cordova.push.remote.HmsPushMessageService}
04-25 10:20:01.809 W/PushLog110105309( 5138): [ReceiverDispatcher-209]start remote message service failed
04-25 10:20:01.813 I/PushLog110105309( 5138): [ReceiverDispatcher-209]message 0A3680A0490F8108 is cached success: true
04-25 10:20:01.814 I/PushLog110105309( 5138): [ReceiverDispatcher-209]send passby message by start service for: com.****,msgID:0A3680A0490F8108
04-25 10:20:01.814 I/PushLog110105309( 5138): [ReceiverDispatcher-209]process cmdid to send to pushSrv:45, subCmdId:FF
04-25 10:20:01.815 I/PushLog110105309( 5138): [ReceiverDispatcher-209]send msg to remote srv success
04-25 10:20:01.815 I/PushLog110105309( 5138): [ReceiverDispatcher-209]handleMessageResponse the response msg is :45,msgId:0A3680A0490F8108,displayPkgName:com.****,flag:1B
04-25 10:20:01.815 I/PushLog110105309( 5138): [ReceiverDispatcher-209]enter AlarmTools:setInexactAlarm(intent:Intent { act=com.huawei.action.push.intent.CHECK_CHANNEL_CYCLE pkg=android } interval:1200000ms

In killing state, can you find this information in log? " ** onMessageReceived ** "
You can use this command to catch log:
adb logcat -c && adb logcat -vtime > logcat1.txt

the log tells the root cause.
04-25 10:20:01.809 W/ActivityManager( 1461): Service starting has been prevented by iaware or trustsbase sInfo ServiceInfo{8882f89 com.huawei.hms.cordova.push.remote.HmsPushMessageService}
Solution is below. Just add a delay when starting
new Handler().postDelayed(new Runnable() {
#Override
public void run() {
Intent intent = new Intent(getContext() ,ServiceName.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(intent);
} else {
startService(intent);
}
}
},1000);
please refer to this url for more info: https://blog.katastros.com/a?ID=01750-e3e353a0-ceec-4138-b2aa-0c221be37c13

Related

Flutter mqtt - Unicode(Korean) doesn't work

I am using mqtt_client: ^9.6.8 in my flutter project.
I want to subscribe to Korean topics, like topic: "test/안녕"
I want to get messages in Korean, like message: "안녕하세요"
currently if I try to subscribe to a korean topic, the client disconnects and the process just kills itself.
The log was a little bit different before, but this is the current log after I subscribe to a korean topic.
I/flutter (18972): 1-2022-08-09 15:38:40.135206 -- MqttConnectionBase::_onDone - calling disconnected callback
I/flutter (18972): 1-2022-08-09 15:38:40.135985 -- MqttConnectionKeepAlive::stop - stopping keep alive
I/flutter (18972): EXAMPLE::OnDisconnected client callback - Client disconnection
I/flutter (18972): EXAMPLE::OnDisconnected callback is unsolicited or none, this is incorrect - exiting
D/HostConnection(18972): createUnique: call
F/libc (18972): FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xb400006dd36425a0)
D/HostConnection(18972): HostConnection::get() New Host Connection established 0xb400006de3607310, tid 19012
F/libc (18972): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 19013 (1.raster), pid 18972
if I send a korean message, then it comes like HÅU± which is not what I want.
I tried to decode with utf8 but I can't seem to do it correctly.
Any helps on this? thanks for every suggestion!!
--edit--
this is the part where I print the received mqtt message
client.updates!.listen((List<MqttReceivedMessage<MqttMessage?>>? c) {
final recMess = c![0].payload as MqttPublishMessage;
final pt =
MqttPublishPayload.bytesToStringAsString(recMess.payload.message);
context.read<SubTopic>().newTopic(c[0].topic);
context.read<SubMessage>().newMessage(pt);
print('Notification: topic is <${c[0].topic}>, payload is <$pt>');
});
this is where I subscribe to the topic
try {
await client.connect();
} on NoConnectionException catch (e) {
print('EXAMPLE::client exception - $e');
client.disconnect();
} on SocketException catch (e) {
print('EXAMPLE::socket exception - $e');
client.disconnect();
}
if (client.connectionStatus!.state == MqttConnectionState.connected) {
print('EXAMPLE::Mosquitto client connected');
for (String topic in _subTopicList) {
print(topic);
client.subscribe(topic, MqttQos.exactlyOnce);
}
} else {
print(
'EXAMPLE::ERROR Mosquitto client connection failed - disconnecting, status is ${client.connectionStatus}');
client.disconnect();
// exit(-1);
}

ignite client can not reconnect to ignite Kubernetes cluster,after pod restart

below if client code config
KubernetesConnectionConfiguration kcfg = new KubernetesConnectionConfiguration();
kcfg.setNamespace(igniteK8sNameSpace);
kcfg.setServiceName(igniteK8sServiceName);
cfg.setAddressesFinder(new ThinClientKubernetesAddressFinder(kcfg));
cfg.setRetryPolicy(new ClientRetryAllPolicy());
after ignite pod restart
client throw Exception
org.apache.ignite.client.ClientConnectionException: Connection timed out
at org.apache.ignite.internal.client.thin.io.gridnioserver.GridNioClientConnectionMultiplexer.open(GridNioClientConnectionMultiplexer.java:144)
at org.apache.ignite.internal.client.thin.TcpClientChannel.<init>(TcpClientChannel.java:178)
at org.apache.ignite.internal.client.thin.ReliableChannel$ClientChannelHolder.getOrCreateChannel(ReliableChannel.java:917)
at org.apache.ignite.internal.client.thin.ReliableChannel$ClientChannelHolder.getOrCreateChannel(ReliableChannel.java:898)
at org.apache.ignite.internal.client.thin.ReliableChannel$ClientChannelHolder.access$200(ReliableChannel.java:847)
at org.apache.ignite.internal.client.thin.ReliableChannel.applyOnDefaultChannel(ReliableChannel.java:759)
at org.apache.ignite.internal.client.thin.ReliableChannel.applyOnDefaultChannel(ReliableChannel.java:731)
at org.apache.ignite.internal.client.thin.ReliableChannel.service(ReliableChannel.java:167)
at org.apache.ignite.internal.client.thin.ReliableChannel.request(ReliableChannel.java:288)
at org.apache.ignite.internal.client.thin.TcpIgniteClient.getOrCreateCache(TcpIgniteClient.java:185)
and i use retry to reconnect and print clientConfiguration.getAddressesFinder().getAddresses() and it address is pod address,but client not reconnect
while (retryTimeTmp < retryTimes) {
try {
return igniteClient.getOrCreateCache(new ClientCacheConfiguration()
.setName(cacheName)
.setAtomicityMode(TRANSACTIONAL)
.setCacheMode(PARTITIONED)
.setBackups(2)
.setWriteSynchronizationMode(PRIMARY_SYNC));
}catch (Exception e) {
LOGGER.error("get cache [{}] not success", cacheName, e);
LOGGER.error("get address info [{}], ipfinder [{}]", clientConfiguration.getAddresses(), clientConfiguration.getAddressesFinder().getAddresses());
retrySleep();
} finally {
retryTimeTmp++;
}
https://github.com/apache/ignite/pull/10110.
I pull request and fix this issue

How to return error response to calling channel when TCP destination gives 'Connection refused'

I have this pattern:
channel ESANTE_MPI_CREATE_PATIENT_LISTENER (with a MLLP listener) calls channel ESANTE_MPI_CREATE_PATIENT that calls a TCP destination.
If connection cannot be done in the TCP destination inside ESANTE_MPI_CREATE_PATIENT then this channel reports an error for this destination:(ERROR: ConnectException: Connection refused (Connection refused))
The response transformer does not seem to be called (which is normal as there is no response).
I wonder how I can report the error back to the calling channel ESANTE_MPI_CREATE_PATIENT_LISTENER ?
PS: When tcp destination responds, then I use the response transformer to parse the received frame and create a response message (json error/ok) for the calling channel. Everything works fine here.
My question ends up with: How to trap a Connection refused in a TCP destination to create a response message.
I finally managed this by using the postprocessor script in ESANTE_MPI_CREATE_PATIENT to get the response of the connector and then force a message.
// fake error message prepared for connection refused.
// we put this as the response of the channel destination in order to force a understandable error message.
const sErrorMsg = {
status: "error",
error: "connection refused to eSanté MPI"
};
const TCP_CONNECTOR_ESANTE_MPI_RANK = 2; // WARNING: be sure to take the correct connector ID as displayed into destination.
const TCP_CONNECTOR_ESANTE_MPI_DNAME = 'd' + TCP_CONNECTOR_ESANTE_MPI_RANK; // WARNING: be sure to take the correct connector ID as displayed into destination.
/*
var cms = message.getConnectorMessages(); // returns message but as Immutable
responses. not what we want: we use responseMap instead.
var key = TCP_CONNECTOR_ESANTE_MPI_RANK;
logger.debug(" Response Data=" + cms.get(key).getResponseData());
logger.debug(" Response Data0=" + cms.get(key).getResponseError());
logger.debug(" Response Data1=" + cms.get(key).getResponseData().getError());
logger.debug(" Response Data2=" + cms.get(key).getResponseData().getMessage());
logger.debug(" Response Data3=" + cms.get(key).getResponseData().getStatusMessage());
logger.debug(" Response Data4=" + cms.get(key).getResponseData().getStatus());
*/
var responseMPI = responseMap.get(TCP_CONNECTOR_ESANTE_MPI_DNAME); // return a mutable reponse :-)
if (responseMPI.getStatus()=='ERROR' &&
responseMPI.getStatusMessage().startsWith('ConnectException: Connection refused')) {
// build a error message for this dedicated case
logger.error("connection refused detected");
responseMPI.setMessage(JSON.stringify(sErrorMsg)); // force the message to be responsed.
}
return;

Flutter - Agora Livestreams ends for everyone when a Cohost exits the livestream

I'm having an issue where if an audience member that has been promoted to Cohost exits the active livestream, the stream is ended for everyone. I only want the host that started the livestream to be able to end it, not a cohost.
I have the following code for changing the role from audience to Cohost:
The host sends a message to the audience member they want to promote to cohost --
widget.client.sendMessageToPeer(groups['id'].toString(), AgoraRtmMessage('Hey $username would you like to join this live?', 1, false)).onError((error, stackTrace) => print("Error: $error")) ;
The audience member receives the message and hits enter to accept the promotion to cohost. With the following config:
await _engine.setClientRole(ClientRole.Broadcaster);
await _engine.enableVideo();
client.addOrUpdateChannelAttributes(widget.channelName, [], true).onError((error, stackTrace) => print("Error: $error \n Stacktrace:$stackTrace"));
setState(() {
coHost = true;
});
Navigator.of(context).pop();
That works properly for changing the role of audience member to broadcaster(cohost).
However, when the cohost exits the active livestream it's terminated for everyone. I have the following code that's executed when the cohost exits the active stream:
print("Owner ID IS : $ownerId");
await client.sendMessageToPeer(ownerId, AgoraRtmMessage('I am leaving', 2, false)).whenComplete(() async{
print("Done");
await _engine.setClientRole(ClientRole.Audience);
client.addOrUpdateChannelAttributes(widget.channelName, [AgoraRtmChannelAttribute("TEST", "1")], true);
print("CHANNEL NAME IS :${widget.channelName}.");
I also get the following log output when the Cohost exits the live:
I/flutter ( 2510): Remote Video State is: VideoRemoteState.Stopped
I/flutter ( 2510): Remote Video Reason: VideoRemoteStateReason.RemoteMuted
I/flutter ( 2510): Remote Video State is: VideoRemoteState.Decoding
I/flutter ( 2510): Remote Video Reason: VideoRemoteStateReason.RemoteUnmuted
D/*WEBRTCN*( 2510): VideoRenderAndroid dtor
I/flutter ( 2510): userOffline: 1854772710
I/flutter ( 2510): Remote Video State is: VideoRemoteState.Stopped
I/flutter ( 2510): Remote Video Reason: VideoRemoteStateReason.RemoteOffline
I don't understand what's missing as I believe I'm following the reference docs correctly.
I am using the following for reference : https://docs.agora.io/en/Interactive%20Broadcast/faq/host_set_role

Flutter mqtt_client "MqttBrowserWsConnection::connect - websocket has erred"

I'm receiving an error when connecting to my Mosquitto server in my flutter web project. I'm using the import for mqtt_browser_client.dart and the package mqtt_client.
My code follows the example, and I've checked, I am able to connect to my server from the same PC in MQTT Explorer. (becartpi:8080).
final client = MqttBrowserClient('ws://becArtPi', 'flutter');
void onPRessMQTTTest() async {
client.onDisconnected = onDisconnected;
client.onConnected = onConnected;
client.onSubscribed = onSubscribed;
client.logging(on: true);
client.port = 8080;
client.keepAlivePeriod = 20;
final connMess = MqttConnectMessage()
.withClientIdentifier('flutter')
.startClean() // Non persistent session for testing
.withWillQos(MqttQos.atLeastOnce);
print('EXAMPLE::Mosquitto client connecting....');
client.connectionMessage = connMess;
try {
await client.connect();
} on NoConnectionException catch (e) {
// Raised by the client when connection fails.
print('EXAMPLE::client exception - $e');
client.disconnect();
} on SocketException catch (e) {
// Raised by the socket layer
print('EXAMPLE::socket exception - $e');
client.disconnect();
} catch (e) {
print('MQTT Connection Error: $e');
}
client.updates!.listen((List<MqttReceivedMessage<MqttMessage?>>? c) {
final recMess = c![0].payload as MqttPublishMessage;
final pt =
MqttPublishPayload.bytesToStringAsString(recMess.payload.message);
print(
'EXAMPLE::Change notification:: topic is <${c[0].topic}>, payload is <-- $pt -->');
print('');
});
/// Check we are connected
if (client.connectionStatus!.state == MqttConnectionState.connected) {
print('EXAMPLE::Mosquitto client connected');
} else {
/// Use status here rather than state if you also want the broker return code.
print(
'EXAMPLE::ERROR Mosquitto client connection failed - disconnecting, status is ${client.connectionStatus}');
client.disconnect();
exit(-1);
}
const pubTopic = 'Dart/Mqtt_client/testtopic';
final builder = MqttClientPayloadBuilder();
client.publishMessage(pubTopic, MqttQos.exactlyOnce, builder.payload!);
}
void onDisconnected() {}
void onConnected() {
print(
'EXAMPLE::OnConnected client callback - Client connection was sucessful');
}
void onSubscribed(String topic) {}
EXAMPLE::Mosquitto client connecting....
1-2021-08-18 15:23:35.899 -- MqttClient::connect - keep alive is enabled with a value of 20 seconds
1-2021-08-18 15:23:35.900 -- MqttConnectionKeepAlive:: Initialised with a keep alive value of 20 seconds
1-2021-08-18 15:23:35.900 -- MqttConnectionKeepAlive:: Disconnect on no ping response is disabled
1-2021-08-18 15:23:35.901 -- MqttConnectionHandlerBase::connect - server ws://becArtPi/ws, port 8080
1-2021-08-18 15:23:35.901 -- SynchronousMqttBrowserConnectionHandler::internalConnect entered
1-2021-08-18 15:23:35.901 -- SynchronousMqttBrowserConnectionHandler::internalConnect - initiating connection try 0, auto reconnect in progress false
1-2021-08-18 15:23:35.902 -- SynchronousMqttBrowserConnectionHandler::internalConnect - calling connect
1-2021-08-18 15:23:35.902 -- MqttBrowserWsConnection::connect - entered
1-2021-08-18 15:23:35.903 -- MqttBrowserWsConnection::connect - WS URL is ws://becartpi:8080/ws
1-2021-08-18 15:23:35.906 -- MqttBrowserWsConnection::connect - connection is waiting
1-2021-08-18 15:23:36.068 -- MqttBrowserWsConnection::connect - websocket has erred
1-2021-08-18 15:23:36.069 -- SynchronousMqttBrowserConnectionHandler::internalConnect - connection complete
1-2021-08-18 15:23:36.069 -- SynchronousMqttBrowserConnectionHandler::internalConnect sending connect message
1-2021-08-18 15:23:36.069 -- MqttConnectionHandlerBase::sendMessage - MQTTMessage of type MqttMessageType.connect
Header: MessageType = MqttMessageType.connect, Duplicate = false, Retain = false, Qos = MqttQos.atMostOnce, Size = 0
Connect Variable Header: ProtocolName=MQIsdp, ProtocolVersion=3, ConnectFlags=Connect Flags: Reserved1=false, CleanStart=true, WillFlag=false, WillQos=MqttQos.atLeastOnce, WillRetain=false, PasswordFlag=false, UserNameFlag=false, KeepAlive=20
MqttConnectPayload - client identifier is : flutter
1-2021-08-18 15:23:36.072 -- SynchronousMqttBrowserConnectionHandler::internalConnect - pre sleep, state = Connection status is connecting with return code of noneSpecified and a disconnection origin of none
1-2021-08-18 15:23:41.098 -- SynchronousMqttBrowserConnectionHandler::internalConnect - post sleep, state = Connection status is connecting with return code of noneSpecified and a disconnection origin of none
1-2021-08-18 15:23:41.099 -- SynchronousMqttBrowserConnectionHandler::internalConnect - initiating connection try 1, auto reconnect in progress false
1-2021-08-18 15:23:41.099 -- SynchronousMqttBrowserConnectionHandler::internalConnect - calling connect
1-2021-08-18 15:23:41.099 -- MqttBrowserWsConnection::connect - entered
1-2021-08-18 15:23:41.100 -- MqttBrowserWsConnection::connect - WS URL is ws://becartpi:8080/ws
1-2021-08-18 15:23:41.100 -- MqttBrowserWsConnection::connect - connection is waiting
1-2021-08-18 15:23:41.276 -- MqttBrowserWsConnection::connect - websocket has erred
1-2021-08-18 15:23:41.276 -- SynchronousMqttBrowserConnectionHandler::internalConnect - connection complete
1-2021-08-18 15:23:41.276 -- SynchronousMqttBrowserConnectionHandler::internalConnect sending connect message
1-2021-08-18 15:23:41.277 -- MqttConnectionHandlerBase::sendMessage - MQTTMessage of type MqttMessageType.connect
Header: MessageType = MqttMessageType.connect, Duplicate = false, Retain = false, Qos = MqttQos.atMostOnce, Size = 21
Connect Variable Header: ProtocolName=MQIsdp, ProtocolVersion=3, ConnectFlags=Connect Flags: Reserved1=false, CleanStart=true, WillFlag=false, WillQos=MqttQos.atLeastOnce, WillRetain=false, PasswordFlag=false, UserNameFlag=false, KeepAlive=20
MqttConnectPayload - client identifier is : flutter
1-2021-08-18 15:23:41.277 -- SynchronousMqttBrowserConnectionHandler::internalConnect - pre sleep, state = Connection status is connecting with return code of noneSpecified and a disconnection origin of none
1-2021-08-18 15:23:46.318 -- SynchronousMqttBrowserConnectionHandler::internalConnect - post sleep, state = Connection status is connecting with return code of noneSpecified and a disconnection origin of none
1-2021-08-18 15:23:46.318 -- SynchronousMqttBrowserConnectionHandler::internalConnect - initiating connection try 2, auto reconnect in progress false
1-2021-08-18 15:23:46.319 -- SynchronousMqttBrowserConnectionHandler::internalConnect - calling connect
1-2021-08-18 15:23:46.319 -- MqttBrowserWsConnection::connect - entered
1-2021-08-18 15:23:46.319 -- MqttBrowserWsConnection::connect - WS URL is ws://becartpi:8080/ws
1-2021-08-18 15:23:46.320 -- MqttBrowserWsConnection::connect - connection is waiting
1-2021-08-18 15:23:46.487 -- MqttBrowserWsConnection::connect - websocket has erred
1-2021-08-18 15:23:46.487 -- SynchronousMqttBrowserConnectionHandler::internalConnect - connection complete
1-2021-08-18 15:23:46.487 -- SynchronousMqttBrowserConnectionHandler::internalConnect sending connect message
1-2021-08-18 15:23:46.488 -- MqttConnectionHandlerBase::sendMessage - MQTTMessage of type MqttMessageType.connect
Header: MessageType = MqttMessageType.connect, Duplicate = false, Retain = false, Qos = MqttQos.atMostOnce, Size = 21
Connect Variable Header: ProtocolName=MQIsdp, ProtocolVersion=3, ConnectFlags=Connect Flags: Reserved1=false, CleanStart=true, WillFlag=false, WillQos=MqttQos.atLeastOnce, WillRetain=false, PasswordFlag=false, UserNameFlag=false, KeepAlive=20
MqttConnectPayload - client identifier is : flutter
1-2021-08-18 15:23:46.488 -- SynchronousMqttBrowserConnectionHandler::internalConnect - pre sleep, state = Connection status is connecting with return code of noneSpecified and a disconnection origin of none
1-2021-08-18 15:23:51.521 -- SynchronousMqttBrowserConnectionHandler::internalConnect - post sleep, state = Connection status is connecting with return code of noneSpecified and a disconnection origin of none
1-2021-08-18 15:23:51.522 -- SynchronousMqttBrowserConnectionHandler::internalConnect failed
EXAMPLE::client exception - mqtt-client::NoConnectionException: The maximum allowed connection attempts ({3}) were exceeded. The broker is not responding to the connection request message (Missing Connection Acknowledgement?
1-2021-08-18 15:23:51.523 -- MqttConnectionHandlerBase::disconnect - entered
1-2021-08-18 15:23:51.523 -- MqttConnectionHandlerBase::_performConnectionDisconnect entered
Connection in MQTT Explorer which is connecting and receiving messages correctly.
mosquitto.log
1629283989: Socket error on client 8caab5860e74, disconnecting.
1629284712: Socket error on client <unknown>, disconnecting.
1629284717: Socket error on client <unknown>, disconnecting.
1629284722: Socket error on client <unknown>, disconnecting.
Check the websocket headers API setting you may be sending the wrong headers for your broker.
Have a look at the mqtt_server_client_websocket.dart file in the examples directory, the setting you want is client.websocketProtocols, look at the API for this.