zulip / zulip

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
https://zulip.com
Apache License 2.0
21.3k stars 7.72k forks source link

Push notifications with new API #29768

Closed Dexus closed 3 months ago

Dexus commented 5 months ago

Please add the new FCM API for android push notifications. GCM with key= auth is outdated since last year and not supported for new clients.

timabbott commented 5 months ago

@gnprice FYI -- is this something we need to do?

luckyraul commented 3 months ago

@timabbott

Apps using the deprecated FCM legacy APIs for HTTP and XMPP should migrate to the HTTP v1 API at the earliest opportunity. Sending messages (including upstream messages) with those APIs was deprecated on June 20, 2023, and will be removed on June 21, 2024.

https://firebase.google.com/docs/cloud-messaging/migrate-v1

python-gcm uses this old api

gnprice commented 3 months ago

Thanks @luckyraul for that reference! Yes, it looks like we're going to need to make changes on the server in order to use this new API, and soon.

From my reading of that page, I think we don't need to make any client-side changes, fortunately — it's a new API the server will use, but we can send the exact same messages as far as the client sees them.

There are several different changes happening on the server side, though:

So we'll need to deal with those.

One thing that'll be a bit tricky is that the payloads are constructed by the individual Zulip servers and then passed to the Zulip push notification service in order to send to FCM (or APNs). We can't expect all servers to update in the next 10 days — in fact even if we'd started when the deprecation apparently happened last June, it's normally common for some servers to be running versions older than a year. So we'll need to have the Zulip push notification service take payloads that were written for the old FCM API, and reshape them to fit the new one.

luckyraul commented 2 months ago

@timabbott Please update the documentation for the new FCM integration

mateuszmandera commented 2 months ago

@luckyraul which documentation pages are you referring to? I feel we have updated the relevant places, but may have missed something

luckyraul commented 2 months ago

https://github.com/zulip/zulip/blob/12207407c9abaecb8bd4ff810e24285fbfc3b20b/docs/production/mobile-push-notifications.md?plain=1#L403 seems for me incorrect

joirneto commented 1 month ago

@luckyraul @mateuszmandera Hi, Could you please help me? The documentation is still incorrect. So to send push notifications directly from your server, would I have to configure the key in ANDROID_FCM_CREDENTIALS_PATH ? Would there be any additional configuration? Thank you very much.

luckyraul commented 1 month ago

Yes, ANDROID_FCM_CREDENTIALS_PATH and put service file there