-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can subscribe, but callback isn't triggered on event. #55
Comments
I'm having the exact same problem. First I went through the docs and got my events talking to pusher just fine but my client side code doesn't trigger any callback on the listen method. To be on the safe side I did a bare bones example following along with Matt Stauffers blogs post: https://mattstauffer.co/blog/introducing-laravel-echo Same outcome though. Works just fine for sending the event to pusher but the JS echo aspect just doesn't fire the callback. I switched out laravel echo for the regular pusher library and code and the event is picked up in the browser just fine so I think it's probably an echo issue rather than anything to do with pusher per se.
For reference the 'test' in the listen callback is the public property on my event class |
@cedricve - I'm guessing you're not getting any other error messages in the console either right? What sort of app are you building? Mine's a single page application built using vue js, vue router and vuex. Not sure that should make any difference but figured it was worth seeing if there are any similarities/differences in our use cases |
Well, it's just a proof-of-concept the code is in the bootstrap.js file, as recommended by the documentation. I was really hoping to get this work.. I think I'll move to the official library as wel. Thanks for the help |
Yeah, bit frustrating as Echo has some features that look pretty neat so I'd like to get it working if possible. If anyone else has any ideas or is having the same issue then I'd be happy to provide more info on my own usage |
Just as a further update, I've just created a bare-bones test in a new laravel install and I've hit the same wall. Events get pushed to pusher just fine and/or if I create a test event in pusher I can see that my app subscribes in the pusher debug console but the callback just doesn't fire. |
I just use the pusher-js library directly. I just need to fetch the events and run my own functions. |
It has a ton of conveniences that basically I'd rather not have to write from scratch. I realise I can do everything with the pusher-js library I'd just rather get Echo working than reinvent the wheel... |
Well it looks like we will need to wait a little bit longer.. @taylorotwell |
While using pusher's debug tool your namespace will be off unless you change it from the default Laravel setup. See here for how to configure: https://laravel.com/docs/5.3/broadcasting#namespaces |
Aaahhh...got it! Man, that seems so obvious now on a secon read through but totally missed the significance/implications of the namespacing when using the debug tool. Once I prefixed the event name with a ' . ' it started working like a charm. (so for anyone using the pusher test example in the debug tool your echo listener should look like:
Thanks for the response on this one @tlaverdure - you've saved me a ton of time next week! |
@fourstacks Can you post your event code please... |
I posted a similar problem on SO just before finding this issue. Anyway, it did not work for me even with the namespace ( |
@fourstacks thank you man |
|
ohhh mean you saved me |
I've managed to setup and install Laravel-echo correctly however the callback isn't triggered when an event is send from the debug tool. I see the client connecting succesfully. Can someone help?
The text was updated successfully, but these errors were encountered: