-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Notifier] [Firebase] Add Firebase v1 API support #60205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 7.3
Are you sure you want to change the base?
[Notifier] [Firebase] Add Firebase v1 API support #60205
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
|
||
return $sentMessage; | ||
} | ||
|
||
private function getJwt(): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generating JWT is quite a heavy operation and for example a messages worker dedicated to sending push notifications would perform this operation many times.
Can I add caching for the generated JWT? If so, should I add symfony/cache
dependency?
200ece1
to
a83a711
Compare
a83a711
to
1ea778b
Compare
Some tests on Windows are failing. It seems like Rest of the failing tests seem to come from Doctrine bridge which should be unrelated to changes made in this PR. |
f213052
to
4d52e8a
Compare
New Firebase API uses JWT authorization and OpenSSL is needed for signing it.
…nion field from new API New API changed the 'to' field into a union field with 3 different types. This adds backwards-compatible way to support targeting this union field in FirebaseOptions.
…the new v1 API Backwards compatibility was maintained with the old DSN format. A deprecation is triggered when someone tries to create the transport with the old DSN format. Transport created using the old DSN will not be able to send messages and will throw exception for every sent message (this should be consistent with its previous behavior).
The private key used in tests was generated only for the purposes of these tests and is not connected to anything real.
… shape Shape of the endpoint input has changed with the new API. Separating options for messages based on the target platform no longer makes sense as all options for all platforms can now be set for the same message. AndroidNotification, IOSNotification and WebNotification were marked as deprecated and will be removed. FirebaseOptions is no longer abstract and should be used directly.
Reflects changes made by transferring to new v1 API.
4d52e8a
to
0259dce
Compare
This PR adds support for the new v1 API.
The main changes were:
FirebaseOptions
were extended to hold params supported by new APIThis PR does not break backwards compatibility meaning that new Firebase bridge should behave the same way inside the Symfony app as the old one does right now.
Support for the old API was completely removed as the API has been shut down in 2024 already and attempting to use it throws exceptions.
Deprecations
$token
param inFirebaseTransport::__construct()
was deprecated - the param no longer exists for the new APIAndroidNotification
,IOSNotification
andWebNotification
classes were deprecated - new Firebase API allows for all platform specific options to be specified for the message and having options separated by platform limits usabilityFirebaseTransport
with the old DSN format a deprecation notice is triggered to inform the user to upgrade (this has been done mainly to not break apps which have theFirebaseTransport
configured with the old credentials format)