Google FCM or Google Cloud Messaging is terrible to setup, understand and use. Documentation looks solid, but it does not give answers to tons of small questions of how it works behind the scene. How to expire subscription? How to unsubscribe everybody from given topic?

I tried to use FCM for push notifications in Web. I even don’t need UI notifications, just some data to be pushed to clients.

Almost succeeded, but last strike came unexpected. It does not work in incognito mode, by design, wtf!!!

Switched to and got it working with PHP in half of day.


  • FCM - Almost a week of setup through console, reading, trying examples, googling issues.
  • Socket.IO - 1 day to setup docker with nginx redirect for websockets, docker container for and code.

Something is very wrong, when product is so hard to use that faster and easier to create own.

# Highlights of my PHP + configuration + client


    location / {
        proxy_pass http://sio;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;


FROM php:7.2-cli AS base
RUN apt-get update && docker-php-ext-install pcntl
CMD [ "php", "./socket.php", "start" ]


use Workerman\Worker;
use PHPSocketIO\SocketIO;
require_once __DIR__ . '/vendor/autoload.php';

$io = new SocketIO(80);
$io->on('connection', function ($socket) use ($io) {
    $socket->on('event', function ($msg) use ($io) {
        $io->emit('event', $msg);

HTML + Javascript

var socket = io();
socket.on('connect', function(){
socket.on('event', function(){