1

I'm making a Client - Server application and I need to send web push notifications.

I have a Laravel api as a backend with laravel echo server with the broadcaster socket.io and a Vue JS ans a Frontend app.

When I try to send the notification from laravel-echo I can see the socket server log. I'm connecting through socket.io and I'm not using pusher.

I have the correct connection because I can see my log, even I can see I'm in because in the console I see my log.

import Echo from "laravel-echo"

window.echo = new Echo({
    broadcaster : 'socket.io',
    host        : url_server+"6001"
});

And I have this code in my Vue component:

window.echo.private("App.Entities.User.2")
.notification(notification => {
    console.log("notification demo", notification)
});

And this is my log notification from laravel server:

[2017-08-09 16:57:02] local.INFO: Broadcasting 
[Illuminate\Notifications\Events\BroadcastNotificationCreated] on channels 
[private-App.Entities.User.2] with payload:
{
 "title": "Hello from Laravel!",
 "body": "Thank you for using our application.",
 "action_url": "https:\/\/laravel.com",
 "created": "2017-08-09T16:57:02-05:00",
 "id": "b3e037ce-9f4e-43d0-a847-e8623f56412d",
 "type": "App\\Notifications\\ReminderSeller",
 "socket": null
}  
Jhon Lemmon
  • 113
  • 2
  • 15
  • I am also facing this [issue](https://github.com/tlaverdure/laravel-echo-server/issues/208) . Please share if you found the solution. – Junaid Ahmad Aug 22 '17 at 19:36

1 Answers1

0

i think its a config issue, make sure that the config is correct in config/broadcasting.php

'default' => env('BROADCAST_DRIVER', 'redis'),

or is set in .env file BROADCAST_DRIVER=redis

Elio Tohme
  • 1
  • 1
  • 5