heywhy / flutter-pusher-client

A pusher.com client written with dart for flutter
MIT License
9 stars 30 forks source link

app stuck on connecting state #19

Open heshesh2010 opened 3 years ago

heshesh2010 commented 3 years ago

Hi ,

app stuck on connecting state i'm using:

FlutterPusher getPusherClient() { var options = PusherOptions(host: '10.0.2.2', port: 6001, encrypted: false);

return FlutterPusher('c48337f612554db6026d', options, lazyConnect: true, enableLogging: true);

}

void connect() { pusherClient.connect(onConnectionStateChange: this.onConnectionStateChange); }

arlandclaudel commented 3 years ago

Im not able to connect to my laravel-websockets server on local machine using vvalet domain name or computer IP.

` wsHost = '192.168......'; FlutterPusher getPusherClient() { PusherOptions options = PusherOptions( host: wsHost, port: 6001, encrypted: true, cluster: 'us3'); return FlutterPusher(pusherAppKey, options, lazyConnect: true, enableLogging: true); }

echo = new Echo({ 'broadcaster': 'pusher', 'client': pusherClient, "wsHost": wsHost, "httpHost": wsHost, "wsPort": 6001, 'auth': { "headers": {'Authorization': 'Bearer $token'} }, 'authEndpoint': 'https://$wsHost/api/broadcasting/auth', "disableStats": true, "forceTLS": true, "enabledTransports": ['ws', 'wss'] });

` Can anybody give me help ?

nicolasvahidzein commented 3 years ago

It is most likely your app id that is missing. I have that variable in my javascript frontend and it's missing in the flutter version.

nicolasvahidzein commented 3 years ago

Look at your CLI messages on the server. It should tell you.