centrifugal / centrifuge-dart

Dart (Flutter) client SDK for bidirectional communication with Centrifugo and Centrifuge-based server over WebSocket

Home Page:https://pub.dartlang.org/packages/centrifuge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I can't connect(setToken)

furkanerkl opened this issue · comments

ErrorEvent{error: Connect error: ClientDisconnectedError}

I am getting this error. I think the problem is that I can't assign the token properly. How can I use the setToken command like in JS. Also how can I make 'debug:true' as in the code below.

const centrifuge = new Centrifuge('url', {
websocket: WebSocket,
debug: true
});

I have same problem

Hello

Could you share server and Dart SDK versions? Note that:

The latest centrifuge-dart is compatible only with the latest Centrifugo server (v4) and Centrifuge >= 0.25.0. For Centrifugo v2, Centrifugo v3 and Centrifuge < 0.25.0 you should use centrifuge-dart v0.8.0.

setToken method not available in the latest Dart SDK, to work with tokens you need to use token and getToken configuration options - see example. This SDK now works according to this spec.

@FZambia As you said, the problem was solved when I changed the library version to v0.8.0.

Awesome, closing then. @enesuludg hopefully you have same issue, if not please open a new one with server/client versions and steps to reproduce