jericopulvera's avatar

Pusher is not receiving my message

I followed this guide until echo part

but I am not receiving the api message.

  • I inserted the keys properly what might be the reason?
0 likes
8 replies
jericopulvera's avatar

already did this and I am successful using vinkla/pusher but I want to use laravel 5.3 broadcasting system to be consistent.

my code reaches the broadcastOn part but I am not receiving an API message at pusher debug console.

This is the event code

class ChatMessageWasReceived implements ShouldBroadcast
{
    use InteractsWithSockets, SerializesModels;

    public $chatMessage;
    public $user;

    public function __construct($chatMessage, $user)
    {
        $this->chatMessage = $chatMessage;
        $this->user = $user;
    }

    public function broadcastOn()
    {
        return [
            "chat-room.1"
        ];
    }
}
Kemito's avatar
Kemito
Best Answer
Level 9

I will tell you a secret.

Most likely you are connecting to wrong cluster (by default it believe it is US) In Laravel Echo it will tell you that you connect to wrong (gives you a hint) but when you fire an event and nothing happens and logs say nothing most likely that will be the problem. Set 'cluster' => 'your-cluster' in config file under 'options' and try again.

If this is the case i believe it should be atleast in docs (or im blind)

4 likes
JarekTkaczyk's avatar

@Eco012390 I second what @Kemito said - had the very same issue yesterday. And agreed, it should go to the docs - Kemito a PR to the docs maybe?

1 like
jericopulvera's avatar

still not working.

 'pusher' => [
            'driver' => 'pusher',
            'key' => env('PUSHER_KEY'),
            'secret' => env('PUSHER_SECRET'),
            'app_id' => env('PUSHER_APP_ID'),
            'options' => [
                'cluster' => 'ap1',
                'encrypted' => true
            ],
jericopulvera's avatar

Ok It works now! Thank you guys

  • I just removed the encryptred => true.
  • what does it do anyways?
ddustin's avatar

In my case, im sure I’ve put in the right cluster. It’s totally working in my local but after deploying it to the remote windows server I started getting a BroadcastException No Message error. I’ve read some stuff where they just cleared the config cache or turned the encrypted option to false but none of those have worked for me. Should I create another app and register it to another cluster? any suggested solution would be greatly appreciated. Thanks!

Please or to participate in this conversation.