Unable to enable push notifications

938 views
Skip to first unread message

Dilshan Sandhu

unread,
Aug 2, 2022, 6:56:45 AM8/2/22
to Tinode General
Hi everyone,
I was testing the functionality of the default push notification feature provided by the tinode TNPG (Tinode Push Gateway).
I followed the instructions given here (https://github.com/tinode/chat/tree/master/server/push/tnpg)

Client and server are working locally.
I have tls enabled(https).
But i am unable to enable push notification.
Screenshot_20220802_162533.png
Anything i am doing wrong?

Gene

unread,
Aug 2, 2022, 11:13:22 AM8/2/22
to Tinode General
Please show the client-side logs (javascript console).

Gene

unread,
Aug 2, 2022, 11:19:15 AM8/2/22
to Tinode General
What kind of browser do you use?

Dilshan Sandhu

unread,
Aug 3, 2022, 4:50:08 AM8/3/22
to Tinode General
It somehow fixed, now it allows me to enable Notification alerts.
But i am having this another error

tnpg: invalid config SenderId mismatch
User1 at -> TinodeWeb/0.19.3 (Edge/104.0; Linux x86_64); tinodejs/0.19.3 -> deviceId generated
User2 at -> TinodeWeb/0.19.3 (Opera/89.0; Linux x86_64); tinodejs/0.19.3 -> deviceId generated
I am using the default firebase-init.js (present at github->tinode->webapp)

Gene

unread,
Aug 3, 2022, 11:13:52 AM8/3/22
to Tinode General
What's your registration id at console.tinode.co?

Dilshan Sandhu

unread,
Aug 3, 2022, 11:24:01 AM8/3/22
to Tinode General
You mean email? dilsha...@gmail.com

Gene

unread,
Aug 3, 2022, 11:40:50 AM8/3/22
to Tinode General
The 'SenderId mismatch' is an FCM error message which indicates that your client initialization credentials do not match the server credentials. It means your 'firebase-init.js' is wrong or contains an error.

Dilshan Sandhu

unread,
Aug 3, 2022, 12:29:44 PM8/3/22
to Tinode General
To clarify, firebase-init.js must be the same as the one present here right? https://github.com/tinode/webapp/blob/924459f84bd10944043877a1f1e8b5315411042b/firebase-init.js
This is mine
// Get these values for your project from the https://console.firebase.google.com/
const FIREBASE_INIT = {
// Set up a web application in console then get the config object.
// The following keys are copied from the object:
apiKey: "AIzaSyD6X4ULR-RUsobvs1zZ2bHdJuPz39q2tbQ",
messagingSenderId: "114126160546",
projectId: "tinode-1000",
appId: "1:114126160546:web:aca6ea2981feb81fb44dfb",
// 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",
};

tinode.conf
"name": "tnpg",
"config": {
// Disabled. Configure first then enable.
"enabled": true,
// Short name (URL) of the organization you registered at console.tinode.co.
"org": "yogram",
// Authentication token obtained from console.tinode.co
"token": "<token>"
}

I am running the server using this command in server folder
go run -tags mongodb . -config=<path-to-custom-config> -static_data=../static/ -listen=:6060 -grpc_listen=:6080

Gene S

unread,
Aug 3, 2022, 4:10:50 PM8/3/22
to tinode

All I can tell you is that Google FCM indicates that the client credentials do not match the server credentials. 

We are using the same configuration for sandbox.tinode.co and production. It works.

--
You received this message because you are subscribed to the Google Groups "Tinode General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinode+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinode/db7c60ec-f8eb-4047-a385-a2939e4867cen%40googlegroups.com.

Dilshan Sandhu

unread,
Aug 5, 2022, 2:23:35 AM8/5/22
to Tinode General
So i was set up my own fcm server and i am getting the same 403 credentials mismatch error, but the funny thing is i am getting the push notification.
fcm: request failed http error status: 403; reason: sender id does not match registration token; code: mismatched-credential; details: SenderId mismatch

Note:- I set it up on a fresh clone of tinode-chat
Screenshot_20220805_114641.png

Gene

unread,
Aug 5, 2022, 1:36:11 PM8/5/22
to Tinode General
It might be an error on Google side.
Reply all
Reply to author
Forward
0 new messages