nahid / talk

Talk is a real-time users messaging and chatting system for Laravel.
MIT License
1.61k stars 327 forks source link

Message is show after the reload the page #75

Open CoderRathore opened 7 years ago

CoderRathore commented 7 years ago

i have implement the chat functionality in project but when i send message to another user than message will not show but when we reload the page the message will show correct. so i want to solve this problem pls help me.

CoderRathore commented 7 years ago

Pls help me sir....

gaurav1992 commented 7 years ago

@nahid Could you please respond on the same. It is really necessary if we are using this library.

FrenchMajesty commented 6 years ago

Same deal here. It seems messages are not being sent to Pusher.

cristianuibar commented 6 years ago

This is happening because of:

    "message": "Call to undefined method Vinkla\\Pusher\\Facades\\Pusher::trigger()",
    "exception": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",
    "file": "C:\\xampp\\htdocs\\opt\\vendor\\nahid\\talk\\src\\Live\\Webcast.php",
    "line": 50,
cristianuibar commented 6 years ago

Ok, found the problem. In Broadcast.php you should use:

use Pusher\Pusher;

instead of

use Pusher;

Thats it. And also make sure you use the right Cluster in your config.

nahid commented 6 years ago

You have to update Talk with version v2.2.1 and also update Talk config file. The config file is contains cluster info so now you can setup cluster by this config.

cristianuibar commented 6 years ago

Yes, I did that. Yet until I added Pusher/Pusher in Broadcast.php I was not able to get the Pusher to work. Now it's working fine and I had to forcefully add that file to my git tracking and whitelist it in gitignore. Not elegant but did the trick.

nahid commented 6 years ago

Please make a PR for this update

tobidsn commented 6 years ago

Same deal here, message is not show after the reload the page. I am using Laravel 5.3 , nahid/talk = 2.2.1 and Server Centos 7,

tobidsn commented 6 years ago

SOLVED for me,

// old controller method $conversations = Talk::getConversationsById($conversationId);

Add Take parameter in getConversationsById // new controller method $conversations = Talk::getConversationsByUserId($id, $offset = 0, $take = 1000);

$messages = $conversations->messages; $withUser = $conversations->withUser; return view('messages.conversations', compact('messages', 'withUser'));

hi @nahid whether "take" can be use for "Paginate" ?

nahid commented 6 years ago

@tobidsn yes take is used for pagination.

please make a pull from master branch, all problems are solved here. I think updated project are running perfectly

rvkvino commented 4 years ago

Hello, I have downloaded and checked this latest version talk example. And I have created account in pusher and I have configured in this .env file also. But still not it's working in live update. I can get the messages if I reload the page. Live update not happening in page. Could you please help me on this ASAP.