diff --git a/Command/ServerCommand.php b/Command/ServerCommand.php index 8eda01c..8c7e147 100644 --- a/Command/ServerCommand.php +++ b/Command/ServerCommand.php @@ -22,6 +22,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $port = $this->getContainer()->getParameter('gfs_notifications.config')['port']; file_put_contents(NotificationBundle::getGfsNotificationToken(),md5(uniqid(rand(),true))); + chmod(NotificationBundle::getGfsNotificationToken(),0777); $notification = $this->getContainer()->getParameter('gfs_notifications.config')['notification']; $server = IoServer::factory( new HttpServer( diff --git a/Notification/Notification.php b/Notification/Notification.php index ad0cf60..4bb491a 100644 --- a/Notification/Notification.php +++ b/Notification/Notification.php @@ -81,7 +81,7 @@ function onMessage(ConnectionInterface $from, $msg) if(!empty($this->users[$notification['userId']])){ foreach ($this->users[$notification['userId']] as $client) { // The sender is not the receiver, send to each client connected - $client->send($msg); + $client->send(json_encode($notification)); } } } diff --git a/composer.json b/composer.json index b71f4af..851d4ae 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "gfs/notifications", - "version": "v1.0.1", + "version": "v1.0.2", "description": "Symfony GFSNotificationsBundle", "keywords": ["User notifications"], "license": "MIT",