Closed ilya-korotya closed 6 months ago
Can you clarify: are you still able to create a legacy API key or have they shut that off completely now?
Using a legacy API key is still allowed, but not recommended. I think FCM may stop supporting legacy API key at any time.
The issue here is that AFAICT Sygnal currently uses the legacy HTTP API https://github.com/matrix-org/sygnal/blob/cac851bc8d750d94bb55d5e152e97c2caf2d8a9f/sygnal/gcmpushkin.py#L72, which doesn't support Oauth token authorization. We probably need to consider migrating to the HTTP v1 API although I don't see any concrete info in the docs relating to a sunset date for the legacy API.
The readme says "server key" but since the parameter is called "api_key" it still took us some time to realize that we explicitly have to enable the "Cloud Messaging API (Legacy)" and use that. If this migration isn't something that can easily be done, maybe just be a bit clearer/explicit about that.
We probably need to consider migrating to the HTTP v1 API although I don't see any concrete info in the docs relating to a sunset date for the legacy API.
@H-Shay The legacy API will be shutdown on 20 June 2024
The legacy API will be shutdown on 20 June 2024
Thanks for the heads up!
I'd recommend having a look at the firebase admin SDK which is also available for python https://firebase.google.com/docs/cloud-messaging/server#firebase-admin-sdk-for-fcm We needed to migrate a lot of projects using the legacy GCM API and found admin SDK to be the most easy. I do not know it for python (we're not using python), but for Java it offers very convenient builders for messages.
Python example:
# This registration token comes from the client FCM SDKs.
registration_token = 'YOUR_REGISTRATION_TOKEN'
# See documentation on defining a message payload.
message = messaging.Message(
data={
'score': '850',
'time': '2:45',
},
token=registration_token,
)
# Send a message to the device corresponding to the provided
# registration token.
response = messaging.send(message)
# Response is a message ID string.
print('Successfully sent message:', response)[cloud_messaging.py]
PS: I am pretty sure that the deadline will be extended by Google. They won't shut every down in June 2024. One should be prepared, though.
@wrjlewis FYI this is not possible to configure a FCM (Firebase Cloud Messaging) pusher for a new Firebase project in a Sygnal instance since June 2023.
Here is a screenshot of a new Firebase project settings in the Firebase Console:
Only FCM HTTP v1 API is allowed for a new project.
June 2024 is the deadline for the existing projects. We should migrate asap to unblock new projects
Quick check-in about the legacy API deadline in June. Heard Element-HQ moved all the stuff over, but can't see Sygnal Pushgateway. Maybe it's still in the pipeline?
Any updates or details on this? Just trying to stay in the loop.
Thanks for any info!
Hey 👋
Heard Element-HQ moved all the stuff over, but can't see Sygnal Pushgateway. Maybe it's still in the pipeline?
Yep thats correct, Sygnal will be moved over shortly.
Any updates or details on this? Just trying to stay in the loop.
I can't give specifics on when exactly. But we're trying to get this scheduled asap and well ahead of the API shut off date. Lack of specifics on that just due to the team's other commitments and being a smaller team.
This is coming in like ~3 months. Is anyone working on this?
@devonh can we consider this ticket closed by https://github.com/matrix-org/sygnal/pull/361? is there still any pending work?
Support has been added in today's release - https://github.com/matrix-org/sygnal/releases/tag/v0.14.0
FTR, this is an e-mail I have received today:
We’d like to let you know that due to the high number of extension requests, we have decided to delay the shutdown time to July 20, 2024.
Is your feature request related to a problem? Please describe. FCM asks to stop using legacy authorization and switch to OAuth 2.0 https://firebase.google.com/docs/cloud-messaging/auth-server. But it looks like sygnal only supports authorization via
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
which is the old approach.Describe the solution you'd like Add a field to the config that will determine what type of authorization I want to use. Legacy or OAuth 2.0.
Additional context