nahid / talk-example

This project is demo for Laravel-Talk package and its also Docker ready
http://github.com/nahid/talk
131 stars 77 forks source link

Server pusher don't send message to pusher debug console #29

Closed ATNoosh closed 6 years ago

ATNoosh commented 6 years ago

Hi. I installed nahid talk v2.2.1 on laravel 5.2. Using talk_live helper, subscription messages are visible in debug console in pusher account. But server pusher don't send any message to the pusher.com server. My config in talk.php is correct. In the Broadcast.php $pusher object is ok but $pusher->get_channels() returns null.

I traced the code in ajaxSendMessage. Then Talk::sendMessageByUserId($userId, $body) called. Then sendMessageByUserId. Then makeMessage inside Talk.php. Then line
$this->broadcast->transmission($message); transmission in Broadcast.php returns false because the $pusher is null.

I noticed to the Debug Console in pusher, about 5 seconds after subscription to the channels, channels Disconnection occur in some cases.

nahid commented 6 years ago

Please share your config

ATNoosh commented 6 years ago

`<?php

return [ 'user' => [ 'model' => 'App\User', ], 'broadcast' => [ 'enable' => true, 'app_name' => 'my-app-name', 'pusher' => [ 'app_id' => '------', 'app_key' => '--------------------', 'app_secret' => '--------------------', 'options' => [ 'cluster' => '---', 'encrypted' => true ] ], ], ]; `

ATNoosh commented 6 years ago

Of course I also tested below config: <?php

return [ 'user' => [ 'model' => 'App\User', ], 'broadcast' => [ 'enable' => false, 'app_name' => 'my-app-name', 'pusher' => [ 'app_id' => '------', 'app_key' => '--------------------', 'app_secret' => '--------------------', 'options' => [ 'cluster' => '---', 'encrypted' => true ] ], ], ];

Bobyuan1015 commented 6 years ago

have you solved this problem

ATNoosh commented 6 years ago

Yes. I solved myself. I found that my config attributes in the vendor/talk are empty. So changed the talk code to use my hard code config.

nahid commented 6 years ago

please share your changes