olubunmitosin/laravel_flutter_pusher

Keeps Reconnecting

Closed this issue · 4 comments

Hello , first of all, thank you for this wonderful package.

Any time i use the below code , my app connect to the laravel websocket succesfully on android but nothing happens on ios :

var options = PusherOptions(
host: PusherConfig.host, port: 6001, encrypted: false, cluster: 'eu');

LaravelFlutterPusher pusher = LaravelFlutterPusher(
    PusherConfig.appKey, options,
    enableLogging: true);
//
pusher
    .subscribe('channel')
    .bind('event', (event) => print('event =>' + event.toString()));

so i decide to use it with laravel_echo package , maybe that is the issue but anytime i combine the code with the echo , it doesnt work , it just keep writing connecting....reconnecting..connecting....reconnecting..connecting....reconnecting....

below is the code with echo

var options = PusherOptions(
host: PusherConfig.host, port: 6001, encrypted: false, cluster: 'eu');

LaravelFlutterPusher pusher = LaravelFlutterPusher(
    PusherConfig.appKey, options,
    enableLogging: true);

Echo echo = new Echo({
'broadcaster': 'pusher',
'client': pusher,
});

echo.channel('public-channel').listen('PublicEvent', (e) {
print(e);
});

Please assist.
Thanks

pardon me please , i entered wrong host in the configuration

Thank you for your work. It would be so much nice if we can be able to trigger an event to the subscribed channel too