Im currently making a app that needs to have live updates, Im using pusher_client: ^2.0.0 and laravel_echo: ^0.2.2. I created a function which I call on initState :
PusherOptions options = PusherOptions(
host: 'reservegcc.com',
wsPort: 6001,
encrypted: false,
);
PusherClient pusher = PusherClient('11111', options, autoConnect: false);
Echo echo = Echo({
'broadcaster': 'pusher',
'client': pusher,
"wsHost": 'reservegcc.com',
"wsPort": 6001,
"disableStats": true,
'wssPort': 6001,
'forceTLS': true,
'enabledTransports': ['ws', 'wss']
});
echo.channel('restaurant-transactions').listen('Transaction', (e) {
print(e);
});
echo.connector.pusher.onConnectionStateChange((state) {
print(state!.currentState.toString());
});
echo.connector.pusher.connect();
}```
Im getting connecting and reconning on the onConnectionStateChange, Can someone please help me what is lacking on my code. I have done a lot of research but still cannot connect.