Skip to content

subscribeTopics not working #8

@yurik94

Description

@yurik94

Hello, I'm trying to implement this lib.
I have a fully working Mercure instance with Docker, I'm sure it's working because from plain JS it works fine.

Future<Mercure> initMercure() async {

mercureClient =
        Mercure(token: authMercure.jwt, hub_url: authMercure.hub_url);

    // Subscribes to topics
    mercureClient.subscribeTopics(
        topics: authMercure.topics,
        onData: (Event event) {
          print(event.data);
        },
        onError: (Object o) {
          print('onError');
        },
        onDone: () {
          print('onDone');
        });
        return mercureClient;
}

none of the callbacks are called, from chrome/web I see the stream opened successfully with 200 code.

called from:

class _MyHomePageState extends State<MyHomePage> {
  Mercure mercureClient;
  //...

  @override
  Future<void> initState() {
    super.initState();
    // ...
    initMercure();
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions