Skip to content
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

real time not working #6

Open
omaribarra-dev opened this issue Nov 9, 2016 · 10 comments
Open

real time not working #6

omaribarra-dev opened this issue Nov 9, 2016 · 10 comments

Comments

@omaribarra-dev
Copy link

thanks for the chat but i have cloned the repo an it isn working because the messages arent appearing in real time the bind isnt workiing i have placed an alert to:

channel.bind('App\\Events\\MessagePublished', function (response) {
            // Update message list for everyone except the message author
            alert("Publicando");
            if (response.message.username !== _this.username) {
              alert("Publicandos");
                _this.messages.push(response.message);
            }
        });

but it doesnt work what could be happening

@jahvi
Copy link
Owner

jahvi commented Nov 9, 2016

Did you set up your pusher credentials? The code is the same one that's hosted on the demo so it makes me thing it's a configuration issue.

@omaribarra-dev
Copy link
Author

Yes i have set up the pusher crddentials
Its weird i have read maybe its a timezone issue

@jahvi
Copy link
Owner

jahvi commented Nov 9, 2016

Maybe, is the demo working fine for you? Also do you get any errors in the console?

@omaribarra-dev
Copy link
Author

It is working only for the online users it shows in real time, only the messages dont.
Im in utm-6 at mexico city

@jahvi
Copy link
Owner

jahvi commented Nov 9, 2016

It shouldn't be a timezone issue then because then the online users wouldn't work, I think it's just the MessagePublished event not firing for some reason. Are you using sync as the QUEUE_DRIVER?

@omaribarra-dev
Copy link
Author

Yes im using sync.
I have downloaded all the proyect form zero but it doesnt work ;(
The messages are in the database but the messages arent appearing in real time the only thing i have changed is:


 this.sendMessage = function () {
        var message = {
            username: _this.username,
            message: _this.message
        };

        // Update message list for author
       // _this.messages.push(message); **//this line was giving me an error like : push is undefined** 
      _this.messages[ Object.keys(_this.messages).length+1]=message; **//So i placed this one** 


        $http.post('messages', message);

        _this.message = '';

    };

@omaribarra-dev
Copy link
Author

but that was on my other proyect.
In the clean one i only have placed the pusher credentials

@omaribarra-dev
Copy link
Author

Im not a laravel expert, im new in this but i thin something is missing in EventServiceProvider at the listeners?
https://github.com/jahvi/chatty/blob/master/app/Providers/EventServiceProvider.php

@jahvi
Copy link
Owner

jahvi commented Nov 10, 2016

The push is undefined issue makes me think it's related to #4

How are you serving the app?

@xx1196
Copy link

xx1196 commented Oct 30, 2020

witch version node need? and i have an error y install composer
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants