Artur
Artur

Reputation: 164

Laravel Echo listenForWhisper not work with React Native

I'm running websockets:serve in Laravel App. Private channels work perfectly, and messaging I have built for it works. Now I'm trying to get the whisper to work for the typing status as well but no luck.

Sending whisper:

Echo.private('chat').whisper('typing', 'data string');

Listen whisper:

Echo.private('chat').listenForWhisper('typing', callback);

In my console, when i'm typing message:

0: connection id 737029829.558252983 received message: {"event":"client-typing","data":"data string","channel":"private-Chat"}.

channels.php:

Broadcast::channel('Chat', function ($user) {
    return $user;
});

But callback function is not called inside listenForWhisper.

Upvotes: 0

Views: 402

Answers (1)

Artur
Artur

Reputation: 164

All is working. I had to set 'enable_client_messages' => true in \config\websockets.php

Upvotes: 2

Related Questions