firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

Usage of legacy API

Open rodolfoamarques opened this issue 1 year ago • 1 comments

Describe your environment

  • Operating System version: all
  • Firebase SDK version: latest (12.2.0)
  • Firebase Product: FCM
  • Node.js version: all
  • NPM version: all

Describe the problem

the messaging().send() method continues to utilise the old API even though it has been deprecated since 2023 and removed since June 2024 as per this documentation

Steps to reproduce:

Calls/Usage of the above method results in a TOPIC_MESSAGE_RATE_EXCEEDED error.

Relevant Code:

in this very repository we can find the following code:

const FCM_SEND_HOST = 'fcm.googleapis.com';
const FCM_SEND_PATH = '/fcm/send';
const FCM_TOPIC_MANAGEMENT_HOST = 'iid.googleapis.com';
const FCM_TOPIC_MANAGEMENT_ADD_PATH = '/iid/v1:batchAdd';
const FCM_TOPIC_MANAGEMENT_REMOVE_PATH = '/iid/v1:batchRemove';

According to the latest documentation, the API to be used should be https://fcm.googleapis.com/v1/projects/{PROJECT_ID}/messages:send

rodolfoamarques avatar Jul 16 '24 20:07 rodolfoamarques

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Jul 16 '24 20:07 google-oss-bot

related: https://github.com/firebase/firebase-admin-node/issues/2602

jhb-dev avatar Aug 30 '24 10:08 jhb-dev

Thanks @devj3ns !

Hey folks, please see my response in https://github.com/firebase/firebase-admin-node/issues/2602#issuecomment-2322053273

The deprecated endpoints mentioned in the issue are being used in sendToTopic and sendToCondition` APIs. These APIs are now deprecated in v12.4.0+

lahirumaramba avatar Aug 30 '24 17:08 lahirumaramba