chinloyal / pusher_client

A Pusher Channels Client for Fluttter (Fully supports Android and iOS)
https://pusher.com/channels
MIT License
43 stars 181 forks source link

Event Bind not working #19

Closed zohaib-rentalmoose closed 3 years ago

zohaib-rentalmoose commented 3 years ago

Everything is fine working, i even connected to private channels but the problem is your package doesn't listen events event i tried with public events but no luck, i can see in console these logs

Launching lib\main.dart on sdk gphone x86 arm in debug mode... √ Built build\app\outputs\flutter-apk\app-debug.apk. Connecting to VM Service at ws://127.0.0.1:56524/Tkxj2peMOho=/ws D/PusherClientPlugin(26252): Pusher initialized D/PusherClientPlugin(26252): Event stream cancelled. D/PusherClientPlugin(26252): Event stream listening... D/PusherClientPlugin(26252): [BIND] TestEvent W/System.err(26252): SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". W/System.err(26252): SLF4J: Defaulting to no-operation (NOP) logger implementation W/System.err(26252): SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. D/PusherClientPlugin(26252): [CONNECTING] I/flutter (26252): previousState: DISCONNECTED, currentState: CONNECTING D/PusherClientPlugin(26252): [CONNECTED] I/flutter (26252): previousState: CONNECTING, currentState: CONNECTED D/PusherClientPlugin(26252): [PRIVATE] Subscribed: private-helloworld D/PusherClientPlugin(26252): [ON_EVENT] Channel: private-helloworld, EventName: pusher:subscription_succeeded, D/PusherClientPlugin(26252): Data: null, User Id: null

zohaib-rentalmoose commented 3 years ago

Use laravel broadcastAs method in order to bind events this package doesn't register bind on laravel default class name public function broadcastAs() { return 'server.created'; }