An alternative solution to the notification system is to still use Firebase and other systems BUT end-to-end encrypt every notificaiton to avoid google reading it.

The theory of E2EE encryption

Note : For one-way encryption (notif) only the client must generate his key pair.

Web + Elixir implementation

Elixir Implementation

To load the client public key, use this

def load_pem_b64_rsa(pem_base64) do
  pem_string = :base64.decode(pem_base64)
  [entry] = :public_key.pem_decode(pem_string)
  :public_key.pem_entry_decode(entry)
end

To generate AES key :

def gen_aes_key() do
  :crypto.strong_rand_bytes(32)
  |> :base64.encode()
end