Sending Firebase Cloud Messaging messages to end-user device is not working #540
-
I am using Firebase Admin SDK for PHP to send a notification to mobile app. It was working fine before and suddenly I started getting following error: Message: Unable to connect to the API: cURL error 7: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://oauth2.googleapis.com/token Trace is : Looking into the json file, the URL https://oauth2.googleapis.com/token is the "token_uri". |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If it worked before and suddenly stopped working, it's most likely not a problem with the SDK or with the code in general, but something in the environment. As you've seen in the error, it says "unable to connect to the API", which is a networking issue. This can have several reasons:
On your machine, you can do this for debugging: $ curl -I https://oauth2.googleapis.com/token
If it works with $ curl --version
$ php -i | grep -i curl If the shown versions don't match, especially when the PHP cURL version is lower than the system's cURL version, update the cURL extension of you PHP installation. |
Beta Was this translation helpful? Give feedback.
If it worked before and suddenly stopped working, it's most likely not a problem with the SDK or with the code in general, but something in the environment. As you've seen in the error, it says "unable to connect to the API", which is a networking issue. This can have several reasons: