Enable Push notifications

96 views
Skip to first unread message

Андрій М.

unread,
Sep 12, 2023, 8:54:47 AM9/12/23
to tin...@googlegroups.com

Hi,

Configured according to instructions – https://github.com/tinode/webapp/blob/master/push.md

1) Registered the project at https://firebase.google.com/

2) Configured and downloaded the file – "credentials.json",

3) Double checked that /root/tinode/webapp/firebase-init.js contains the following keys: "apiKey", "messagesSenderId", "projectId", "appId", "messagesVapidKey"

4) Copied the server key by Google-provided to 'tinode.conf' – https://github.com/tinode/chat/blob/master/server/tinode.conf#L511

Commented out the rest:
[...]
//"credentials": {
// "type": "service_account",
// "project_id": "your-project-id",
// "private_key_id": "some-random-looking-hex-number",
// "private_key": "-----BEGIN PRIVATE KEY----- base64-encoded bits of your private key \n-----END PRIVATE KEY-----\n",
// "client_email": "firebase-adm...@your-project-id.iam.gserviceaccount.com",
// "client_id": "1234567890123456789",
// "auth_uri": "https://accounts.google.com/o/oauth2/auth",
// "token_uri": "https://oauth2.googleapis.com/token",
// "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
// "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-abc123%40your-project-id.iam.gserviceaccount.com"
// },
[...]

5) Opened ports in the firewall for Tinode: 3478 (udp|tcp), 5349, 6060, 7880 (tcp).

And opened ports for Google-push: 5228, 5229, 5230 (tcp).

6) Starting the server Tinode, when connecting, it gives an error: «Failed to initialize push notifications»

p.s.

Tell me please, what am I doing wrong?

Thanks.

Gene

unread,
Sep 12, 2023, 11:43:16 AM9/12/23
to Tinode General
You cannot be possibly getting this error on the server side. This got to be a client-side error. 

I guess you are running you client over http, not https?

Andrey M.

unread,
Sep 12, 2023, 12:25:56 PM9/12/23
to Tinode General
There is no error on the server side, everything works. And an https connection is configured through the browser.

вторник, 12 сентября 2023 г. в 18:43:16 UTC+3, Gene:

Andrey M.

unread,
Sep 12, 2023, 12:33:03 PM9/12/23
to Tinode General
There is a suggestion that I entered the "messagesVapidKey" incorrectly, do I understand correctly that you need to copy 'Certificate'?
[...]
// Project Settings -> Cloud Messaging -> Web configuration -> Web Push certificates.
  // This value IS NOT included in the generated js config you get from
  // the firebase console. It needs to be added separately.
  messagingVapidKey: "BOgQVPOMzIMXUpsYGpbVkZoEBc0ifKY_f2kSU5DNDGYI6i6CoKqqxDd7w7PJ3FaGRBgVGJffldETumOx831jl58",
[...]

вторник, 12 сентября 2023 г. в 19:25:56 UTC+3, Andrey M.:

Gene

unread,
Sep 12, 2023, 12:48:14 PM9/12/23
to Tinode General
On Tuesday, September 12, 2023 at 9:33:03 AM UTC-7 Andrey M. wrote:
There is a suggestion that I entered the "messagesVapidKey" incorrectly, do I understand correctly that you need to copy 'Certificate'?

Yes

Andrey M.

unread,
Sep 12, 2023, 1:32:42 PM9/12/23
to Tinode General
Gene, have I configured the HTTPS connection correctly?
[...]
"listen": ":443",
"tls": {
  // Enable TLS.
  "enabled": true,
  "http_redirect": ":443",
[...]

вторник, 12 сентября 2023 г. в 19:48:14 UTC+3, Gene:
Reply all
Reply to author
Forward
0 new messages