small fix

This commit is contained in:
Thomas Fransolet 2023-12-05 15:41:13 +01:00
parent 0e7fcd6517
commit b32528048e
2 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,9 @@ class MQTTHelper {
handleMessage(appContext, c);
});*/
} else {
print("Coucou test");
print(tabletAppContext);
print(tabletAppContext.clientMQTT);
tabletAppContext.clientMQTT!.updates!.listen((List<MqttReceivedMessage<MqttMessage>> c) async {
handleMessage(appContext, c);
});
@ -178,7 +181,7 @@ class MQTTHelper {
tabletAppContext.clientBrowserMQTT!.disconnect();
}*/
} else {
tabletAppContext.clientMQTT = MqttServerClient.withPort(hostToTake!.replaceAll('https://api.', ''), 'tablet_app_'+identifier!, 1883);
tabletAppContext.clientMQTT = MqttServerClient.withPort(hostToTake!.replaceAll('https://api.', ''), 'tablet_app_'+identifier, 1883);
tabletAppContext.clientMQTT!.logging(on: true);
tabletAppContext.clientMQTT!.keepAlivePeriod = 20;
tabletAppContext.clientMQTT!.onDisconnected = onDisconnected;

View File

@ -44,6 +44,7 @@ void main() async {
}
} else {
print("NO LOCAL DB !");
localContext = TabletAppContext(host: "https://api.mymuseum.be");
}
if(kIsWeb) {