skip to Main Content

I did not change anything in my code & web panel. Previously, my notifications was working without a problem. For 5-6 days push notifications are not working, I’m trying to send manually(from Firebase dashboard) but it does not show whether it has been sent or not.

Did you encounter with a problem in your app by using Firebase Cloud Messaging? I mean, automatic push notifications from web panel.(not manually from Firebase dashboard)

and they only showed "Campaign Metrics" problem not Service Disruption or Service Outage.

https://status.firebase.google.com

Did I make a mistake in my web panel or my Flutter app but it was working for 2-3 years without a problem, only 5-6 days not working…
Any help will be appreciated

2

Answers


  1. I also faced similar issue. Flutter Legacy FCM APIs have been depreciated. and you have to upgrade it to HTTP v1 API

    you can found detail here
    https://firebase.google.com/docs/cloud-messaging/migrate-v1

    Login or Signup to reply.
  2. FCM API Change: Sending Notifications Using OAuth Tokens

    Google Firebase has recently changed the way requests are made to send push notifications using Firebase Cloud Messaging (FCM). Below is a guide on how to use the new API format and generate OAuth tokens for authorization.

    Old API Request:

    URL https://fcm.googleapis.com/fcm/send

    headers
    
    {
      "Authorization": "key=AAAAtXILhBA:APA91bH9..."
    }
    
    body
    
    {
      "data": {
        "message": "Notification msg !!!",
        "title": "New Notification"
      },
      "priority": "high",
      "to": "fcm_token"
    }
    

    New API Request (As of Firebase update):

    URL: https://fcm.googleapis.com/v1/projects/salezrobot/messages:send
    
    Headers
    
    {
      "Content-Type": "application/json",
      "Authorization": "Bearer ya29.a0AcM612x7sfqwzPZN8..."
    }
    
    Body
    
    {
      "message": {
        "token": "device_fcm_token",
        "data": {
          "message": "Notification msg",
          "title": "Notification title"
        }
      }
    }
    

    The Authorization header now requires an OAuth token (not an API key).
    This token expires every hour and needs to be regenerated
    programmatically.

    How to Generate OAuth Token for Testing (Using Postman):

    1. Open the OAuth 2.0 Playground.

    2. In the left panel, select:

    * Firebase Cloud Messaging API v1.
    
    * Then, check https://www.googleapis.com/auth/cloud-platform.
    

    enter image description here

    3. Click Authorize APIs, and login or select your Google account.

    enter image description here

    4. After authorization, click Exchange authorization for tokens

    5. Copy the generated OAuth token. You can use this token for testing in Postman or other tools.

    Important Note:

    The OAuth token will expire in 1 hour, so it needs to be regenerated. For production, you should generate this token programmatically using the steps described here.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search