Laravel Echo listenForWhisper 不适用于 React Native

阿图尔

我正在运行websockets:serve在 Laravel 应用程序中。私人频道完美运行,我为它构建的消息传递也有效。现在我试图让耳语也适用于打字状态,但没有运气。

发送耳语:

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

听耳语:

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

在我的控制台中,当我输入消息时:

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

频道.php:

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

但是在listenForWhisper 中没有调用回调函数。

阿图尔

一切都在工作。我必须\config\websockets.php 中设置'enable_client_messages' => true

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章