kakajansh / echo

Laravel Echo for your Flutter apps.
MIT License
108 stars 70 forks source link

join presense channel i get this error #19

Closed mghase closed 4 years ago

mghase commented 4 years ago

D/FlutterPusherPlugin( 4003): init D/FlutterPusherPlugin( 4003): connect W/System.err( 4003): SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". W/System.err( 4003): SLF4J: Defaulting to no-operation (NOP) logger implementation W/System.err( 4003): SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. D/FlutterPusherPlugin( 4003): subscribe error: Cannot subscribe to a private or presence channel because no Authorizer has been set. Call PusherOptions.setAuthorizer() before connecting to Pusher W/System.err( 4003): java.lang.IllegalStateException: Cannot subscribe to a private or presence channel because no Authorizer has been set. Call PusherOptions.setAuthorizer() before connecting to Pusher W/System.err( 4003): at com.pusher.client.Pusher.throwExceptionIfNoAuthorizerHasBeenSet(Pusher.java:341) W/System.err( 4003): at com.pusher.client.Pusher.subscribePresence(Pusher.java:317) W/System.err( 4003): at com.github.heywhy.flutter_pusher.PusherInstance.subscribe(PusherInstance.java:255) W/System.err( 4003): at com.github.heywhy.flutter_pusher.PusherInstance.onMethodCall(PusherInstance.java:59) W/System.err( 4003): at com.github.heywhy.flutter_pusher.FlutterPusherPlugin.onMethodCall(FlutterPusherPlugin.java:60) W/System.err( 4003): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231) W/System.err( 4003): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93) W/System.err( 4003): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642) W/System.err( 4003): at android.os.MessageQueue.nativePollOnce(Native Method) W/System.err( 4003): at android.os.MessageQueue.next(MessageQueue.java:325) W/System.err( 4003): at android.os.Looper.loop(Looper.java:142) W/System.err( 4003): at android.app.ActivityThread.main(ActivityThread.java:6549) W/System.err( 4003): at java.lang.reflect.Method.invoke(Native Method) W/System.err( 4003): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:451) W/System.err( 4003): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:888) D/FlutterPusherPlugin( 4003): bind exception: Attempt to invoke interface method 'void com.pusher.client.channel.Channel.bind(java.lang.String, com.pusher.client.channel.SubscriptionEventListener)' on a null object reference W/System.err( 4003): java.lang.NullPointerException: Attempt to invoke interface method 'void com.pusher.client.channel.Channel.bind(java.lang.String, com.pusher.client.channel.SubscriptionEventListener)' on a null object reference W/System.err( 4003): at com.github.heywhy.flutter_pusher.PusherInstance.bind(PusherInstance.java:314) W/System.err( 4003): at com.github.heywhy.flutter_pusher.PusherInstance.onMethodCall(PusherInstance.java:65) W/System.err( 4003): at com.github.heywhy.flutter_pusher.FlutterPusherPlugin.onMethodCall(FlutterPusherPlugin.java:60) W/System.err( 4003): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231) W/System.err( 4003): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93) W/System.err( 4003): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642) W/System.err( 4003): at android.os.MessageQueue.nativePollOnce(Native Method) W/System.err( 4003): at android.os.MessageQueue.next(MessageQueue.java:325) W/System.err( 4003): at android.os.Looper.loop(Looper.java:142) W/System.err( 4003): at com.github.heywhy.flutter_pusher.PusherInstance.bind(PusherInstance.java:314) W/System.err( 4003): at com.github.heywhy.flutter_pusher.PusherInstance.onMethodCall(PusherInstance.java:65) W/System.err( 4003): at com.github.heywhy.flutter_pusher.FlutterPusherPlugin.onMethodCall(FlutterPusherPlugin.java:60) W/System.err( 4003): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231) W/System.err( 4003): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93) W/System.err( 4003): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642) W/System.err( 4003): at android.os.MessageQueue.nativePollOnce(Native Method) W/System.err( 4003): at android.os.MessageQueue.next(MessageQueue.java:325) W/System.err( 4003): at android.os.Looper.loop(Looper.java:142) W/System.err( 4003): at android.app.ActivityThread.main(ActivityThread.java:6549) W/System.err( 4003): at java.lang.reflect.Method.invoke(Native Method) W/System.err( 4003): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:451) W/System.err( 4003): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:888) I/flutter ( 4003): cnnected E/EGL-ERROR: egl_platform_cancel_buffers:644: surface->num_buffers(4) D/Surface ( 4003): Surface::disconnect(this=0x95047000,api=1) D/GraphicBuffer( 4003): unregister, handle(0x9500a500) (w:720 h:1404 s:720 f:0x1 u:f02) D/GraphicBuffer( 4003): unregister, handle(0x8f7c9d40) (w:720 h:1404 s:720 f:0x1 u:f02) D/Surface ( 4003): Surface::disconnect(this=0x95047000,api=-1) D/FlutterView( 4003): Detaching from a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@c795a31 E/EGL-ERROR: egl_platform_cancel_buffers:644: surface->num_buffers(4) D/Surface ( 4003): Surface::disconnect(this=0x95036000,api=1) D/GraphicBuffer( 4003): unregister, handle(0x9500a380) (w:720 h:1500 s:720 f:0x1 u:f02) D/GraphicBuffer( 4003): unregister, handle(0x9500a980) (w:720 h:1500 s:720 f:0x1 u:f02) V/PhoneWindow( 4003): DecorView setVisiblity: visibility = 4, Parent = ViewRoot{98c36d8 com.example.mkulima/com.example.mkulima.MainActivity,ident = 0}, this = DecorView@317ce4a[MainActivity]

mghase commented 4 years ago

java.lang.IllegalStateException: Cannot subscribe to a private or presence channel because no Authorizer has been set. Call PusherOptions.setAuthorizer() before connecting to Pusher W/System.err( 4003): at

PusherOptions.setAuthorizer() methde never exist

heywhy commented 4 years ago

What version of the flutter_pusher_client are you running?

mghase commented 4 years ago

latest one

On Sun, Apr 19, 2020 at 1:11 AM atanda rasheed notifications@github.com wrote:

What version of the flutter_pusher_client are you running?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kakajansh/echo/issues/19#issuecomment-615960647, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABS755PAORWTMHK762DVFF3RNIQQNANCNFSM4MKWOFQQ .

peterson-umoke commented 4 years ago

same issue here, my guy, how far now, abeg do fix this issue, thanks jare

peterson-umoke commented 4 years ago

in fact na only the public channels dey work, this thing get as e be oh, wetin be the problem ?

heywhy commented 4 years ago

I want to assume you set the auth field on the PusherOption, right?

peterson-umoke commented 4 years ago

Let me share the codebase

heywhy commented 4 years ago

A snippet of the pusher initialization block is enough.

peterson-umoke commented 4 years ago

I have made some changes and i now receiving yet another different error. here is my codebase.

String _authUrl = "http://$url:$port/broadcasting/auth";
      Map headers = await _headers;

      log("the authrlksdlfsdf ${headers['Authorization']}");

      PusherAuth _pusherAuth = PusherAuth(
        _authUrl,
        headers: headers,
      );
      log("${_pusherAuth.toJson()}");

      PusherOptions _pusherOptions = PusherOptions(
        host: url,
        port: port,
        encrypted: false,
        auth: _pusherAuth,
      );

      _pusher = FlutterPusher(
        appKey,
        _pusherOptions,
        lazyConnect: true,
        enableLogging: true,
        onConnectionStateChange: (ConnectionStateChange events) =>
            log("${events.currentState}"),
        onError: (ConnectionError e) =>
            log("Error occurred logging you in with auth tokens ${e.toJson()}"),
      );

      _pusher.connect();
      _echo = new Echo({
        "broadcaster": "pusher",
        "client": _pusher,
      });

      try {
//        _echo
//            .channel('heartbeat')
//            .listen('Heartbeat', (e) => log("Public channel result: $e"));
        _echo
            .private('heartbeat')
            .listen('Heartbeat', (e) => log("Private channel result: $e"));
      } on PlatformException catch (e) {
        print("Error occurred trying to login with your key, $e");
      }

event though i have updated this, i keep getting error that the headers are not been set

heywhy commented 4 years ago

I'll like you to create an issue at flutter_pusher_client. This issue is not related to this library.

peterson-umoke commented 4 years ago

I'll like you to create an issue at flutter_pusher_client. This issue is not related to this library.

no wahala.

Ochieng424 commented 4 years ago

Facing the same issue. Any fixes?