pusher-channels-flutter icon indicating copy to clipboard operation
pusher-channels-flutter copied to clipboard

init dos not work

Open ViktorKirjanov opened this issue 3 years ago • 5 comments

it looks like pusher.init dos not work. I took your example, made an app on pusher.com but i dont see any actions after pusher.init. pusher.subscribe dosnot start because we are still waiting for init response try catch dosnt show errors too.

try {
      print("---1");
      await pusher.init(
        apiKey: _apiKey.text,
        cluster: _cluster.text,
        onConnectionStateChange: onConnectionStateChange,
        onError: onError,
        onSubscriptionSucceeded: onSubscriptionSucceeded,
        onEvent: onEvent,
        onSubscriptionError: onSubscriptionError,
        onDecryptionFailure: onDecryptionFailure,
        onMemberAdded: onMemberAdded,
        onMemberRemoved: onMemberRemoved,
        // authEndpoint: "<Your Authendpoint Url>",
        // onAuthorizer: onAuthorizer
      );
      print("---2");
      await pusher.subscribe(channelName: _channelName.text);
      await pusher.connect();
    } catch (e) {
      log("ERROR: $e");
    }

ViktorKirjanov avatar Apr 12 '22 09:04 ViktorKirjanov

Hi @ViktorKirjanov, could you please provide a bit more information about how to reproduce it? Did you try to run on which platform: Android, iOS or web?

Thanks

fbenevides avatar Apr 14 '22 17:04 fbenevides

I am getting the same problem. Works only on rebuild, once you hot reload it stops working.

raducostea avatar Jun 20 '22 09:06 raducostea

Which version are you guys using?

fbenevides avatar Jun 30 '22 14:06 fbenevides

Same issue faced here. User can only be subscribe to the channel once and afterwards hot reloading or creating a new instance user is unable to subscribe again, any fixes available? Using the latest version here

Zechst avatar Sep 01 '22 04:09 Zechst

We have just merged https://github.com/pusher/pusher-channels-flutter/pull/80 which allow for re-initialization. Does that help in your case?

proggen-com avatar Oct 28 '22 05:10 proggen-com