Skip to content

Firebase notifier does not work anymore since messaging protocol updated by google #51147

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

Open
MarinePayet opened this issue Jul 28, 2023 · 6 comments · May be fixed by #60205
Open

Firebase notifier does not work anymore since messaging protocol updated by google #51147

MarinePayet opened this issue Jul 28, 2023 · 6 comments · May be fixed by #60205

Comments

@MarinePayet
Copy link

MarinePayet commented Jul 28, 2023

Symfony version(s) affected

6

Description

Google disable /send api see https://firebase.google.com/docs/cloud-messaging/http-server-ref?hl=en

Caution: Sending messages (including upstream messages) with the FCM XMPP and HTTP legacy APIs was deprecated on June 20, 2023, and will be removed in June 2024. If you are using the legacy send APIs, we strongly recommend that you migrate to the HTTP v1 API or consider using the Admin SDK to build send requests.

Apps using the FCM legacy HTTP API should consider migrating to the HTTP v1 API. See the migration guide for more information about the v1 API's advantages and for migration instruction.

So we cant send any message to old api

How to reproduce

When try to send a message to old api method you will get

In FirebaseTransport.php line 92:
                                                             
  [Symfony\Component\Notifier\Exception\TransportException]  
  Unable to post the Firebase message: <HTML>                
  <HEAD>                                                     
  <TITLE>INVALID_KEY</TITLE>                                 
  </HEAD>                                                    
  <BODY BGCOLOR="#FFFFFF" TEXT="#000000">                    
  <H1>INVALID_KEY</H1>                                       
  <H2>Error 401</H2>                                         
  </BODY>                                                    
  </HTML>    

Due to protected const HOST = 'fcm.googleapis.com/fcm/send';

Possible Solution

Need to implement migrated method : https://firebase.google.com/docs/cloud-messaging/migrate-v1?hl=en

Additional Context

No response

@fabpot
Copy link
Member

fabpot commented Jul 30, 2023

@MarinePayet Do you want to work on a fix?

@MarinePayet
Copy link
Author

I don't know how to do it. I wrote the report with my teacher, I'm a junior. Can you help me ?

@MaurizioMoreo
Copy link

@fabpot how could we achieve this? Any suggestions?

@xabbuh
Copy link
Member

xabbuh commented Sep 11, 2023

Someone (could be you) will have to investigate what needs to be changed in the bridge and open a pull request with the changes needed to make it work again.

@MaurizioMoreo
Copy link

Sorry for the question but I've never contributed to Syfmony: make sense to integrate the notifier with a third-party implementation like https://github.com/kreait/firebase-bundle?

@fabpot
Copy link
Member

fabpot commented Sep 11, 2023

@MaurizioMoreo The goal of the notifier providers is to not depend on anything. We're trying to only support a set of features that are commonly available on all supported providers.
If you need full support, then using a specific bundle makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants