matrix-org / sygnal

Sygnal: reference Push Gateway for Matrix
Apache License 2.0
164 stars 147 forks source link

Missing field or documentation in sygnal yaml? Where do we set SENDER-ID to avoid FCM/GCM error MismatchSenderId #303

Closed jittygitty closed 2 years ago

jittygitty commented 2 years ago

Describe the bug I have a SENDER-ID (a number) in FCM/GCM google console. I get error MismatchSenderId in Sygnal But I see no info/documentation anywhere how/where to set the Sender-ID

To Reproduce Steps to reproduce the behavior:

  1. Setup Sygnal use custom apk name as the app com.etc name in sygnal.yaml
  2. Build Apk with config.xml https push url replaced with your custom server
  3. Try push notification
  4. sygnal.log gives MismatchSenderId error

Expected behavior Expect no MismatchSenderId error if I could put the FCM/GCM "SenderID" number somewhere...

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

jittygitty commented 2 years ago

I thought the MismatchSenderId error in sygnal log was due to missing senderid in sygnal.yaml but perhaps SenderID goes in: https://github.com/vector-im/element-android/blob/develop/vector/src/gplay/debug/google-services.json

I've replaced google-services.json in element android app with my own from firebase fcm/gcm, but still no go, still not getting any notifcation on android phone, though I'm not getting MismatchSenderID anymore.

jittygitty commented 2 years ago

UPDATE currently I think problem is due not to sygnal but a problem with PUSH RULES not propagating from dendrite to element: https://github.com/vector-im/element-android/issues/6115

squahtx commented 2 years ago

Closing, since it sounds related to dendrite. Please reopen if you continue to have issues on matrix.org or a synapse homeserver.

jittygitty commented 2 years ago

@squahtx Thanks yea should be closed, sorry for got to update here but for other's benefit, basically there were two problems:

  1. One was that my apk needed to have not just the PUSH server configured to my server but it needed the package name and senderid to match properly with one in Sygnal config etc otherwise you get MismatchSenderID, so this part had nothing to do with Dendrite but some mistakes/mismatches in Google Json (which is produced by Google Play consoles' FCM and has senderid etc) included in my custom built apk. (It also needs to match Sygnal config for app_id com... etc) The initial confusion is there was no senderid setting in Sygnal, but only the api-key. I discovered the senderid etc comes from the google json in the apk.

  2. Once MismatchSenderID was fixed with proper config, the issue with Dendrite was that when creating users via command line add-user instead of through the "register" process, the "Push Rules" never get properly propagated/triggered in the CLIENT. There was a PULL-REQUEST to fix ( https://github.com/matrix-org/dendrite/pull/2484 ) this but I don't think it's been reviewed or merged yet.

The easy a "workaround" I've been using which gets PUSH notifications working well for me, is here: https://github.com/vector-im/element-android/issues/6115#issuecomment-1137890525