talk icon indicating copy to clipboard operation
talk copied to clipboard

Message is show after the reload the page

Open CoderRathore opened this issue 8 years ago • 12 comments

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 avatar Jul 03 '17 07:07 CoderRathore

Pls help me sir....

CoderRathore avatar Jul 03 '17 08:07 CoderRathore

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

gaurav1992 avatar Aug 24 '17 09:08 gaurav1992

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

FrenchMajesty avatar Sep 11 '17 03:09 FrenchMajesty

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 avatar Oct 09 '17 01:10 cristianuibar

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.

cristianuibar avatar Oct 09 '17 02:10 cristianuibar

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.

nahid avatar Oct 09 '17 08:10 nahid

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.

cristianuibar avatar Oct 09 '17 09:10 cristianuibar

Please make a PR for this update

nahid avatar Oct 09 '17 12:10 nahid

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 avatar Oct 27 '17 01:10 tobidsn

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" ?

tobidsn avatar Oct 27 '17 03:10 tobidsn

@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

nahid avatar Oct 27 '17 12:10 nahid

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.

rvkvino avatar Apr 29 '20 11:04 rvkvino