Migration to HTTP v1 API
Learn to configure the FCM HTTP v1 API for App Push Notifications
Overview
In July 2024, Firebase Cloud Messaging(FCM) will sunset the legacy API. You must migrate to the new HTTP v1 API for app push notifications. This transition is necessary as Google plans to deprecate the legacy API by 20th July 2024.
Netcore has already completed the migration to ensure uninterrupted service. Netcore ensures a seamless experience by handling all necessary technical adjustments. To avoid disrupting your campaign delivery, update your Project ID and Private Key details from your FCM platform to the Netcore CE dashboard.
Before beginning the migration process, ensure you have the following from your Firebase Project:
- Project ID
- JSON Private Key File
Follow these steps to obtain the Project ID and JSON Private Key File details.
- Login to your Firebase dashboard and navigate to your respective Projects.
- Click Project settings > General to obtain your Project ID details. A Firebase project has a unique identifier called the Project ID. This ID is user-defined and serves as a reference name for the project across Firebase and Google Cloud.
![Access FCM Project ID](https://files.readme.io/ab65fdc-Project_ID.gif)
Access FCM Project ID
- Click Service account, and under the Firebase Admin SDK, select these Admin SDK and select the Go** option.
- Click the Generate new private key button to download the JSON file. Then, upload it to the CE dashboard.
![Access FCM Private Key](https://files.readme.io/5ae02d3-Go_copy.gif)
Access FCM Private Key
Prerequisite
You can do the following to enable Firebase Cloud Messaging API:
- Navigate to console.cloud.google.com and click API & Services
![Google Cloud Console](https://files.readme.io/c8fd1e4-API_and_Services.png)
Google Cloud Console
- Click Firebase Cloud Messaging API link by scrolling down to the API list.
![Firebase Cloud Messaging API](https://files.readme.io/003762a-Firebase_cloud_Messaging_API.png)
Firebase Cloud Messaging API
- Click ENABLE if it has not already been entirely enabled.
![Firebase Cloud Messaging API](https://files.readme.io/f5ff9cd-1.png)
Firebase Cloud Messaging API
Configure HTTP V1 API in Netcore CE Dashboard
Configuring the latest HTTP v1 API in your Netcore CE Dashboard ensures seamless integration and optimal performance. Refer to the points below to set up the API for both app and web platforms.
1. App Push
Follow these steps to configure the latest HTTP v1 API with Netcore CE.
- Login to the Netcore CE dashboard.
- Navigate to Settings > Apps.
- Edit any existing Android App and navigate to the Features section.
![Add Project ID and JSON Private Key Details in CE dashboard](https://files.readme.io/943b9c6-FCM.gif)
Add Project ID and JSON Private Key Details in the CE dashboard
- Enable App push notification and navigate to Update FCM server key section.
- Update the Project ID and Private key details acquired from the Firebase dashboard and save your changes.
2. Web push
Follow these steps to configure the latest HTTP v1 API with Netcore CE.
- Login to the Netcore CE dashboard.
- Navigate to Settings > Website.
- Edit any website and navigate to the Advanced features section.
![Add Project ID and JSON Private Key Details in CE dashboard](https://files.readme.io/699c4a1-Private_key_and_product_ID_Web_Push.gif)
Add Project ID and Private Key Details in the CE dashboard
- Enable Browser push notification and navigate to Update FCM details section.
- Update the Project ID, upload the Private key details acquired from the Firebase dashboard, and save your changes.
FCM HTTP v1 API Rate Limits
Warning
With the HTTP v1 API changes, FCM has set a strict rate limit for each project. The HTTP v1 API allows 600,000 tokens per one-minute bucket, which reloads entirely at the end of each one-minute interval.
Failure to comply with this rate limit may result in push notifications not being delivered to users and instead resulting in errors. Such failure will also trigger a non-compliance email from the FCM support team.
Netcore will retry such failed requests when an error related to the rate limit is exceeded is encountered. After ten retries, if the request fails, such notification will be marked as failed in the reports. However, we request that you spread out campaigns over a longer duration or do segment-based campaigns.
API Rate Limit
To check the API rate limit for your Firebase project, follow the below steps:
- Go to console.cloud.google.com and select the project name from the dropdown.
- Select Firebase Cloud Messaging API and click Manage.
- Navigate to the Quotas and System Limits tab.
- Check your Send Requests per Minute Quota, as shown.
![Send Requests per Minuter Quote](https://files.readme.io/b3ec946-Screenshot_2024-06-17_at_2.26.29_PM.png)
Send Requests per Minute Quote
FAQs
Q. What are the steps to migrate from Legacy API to FCM v1 APIs?
A. Refer to the migration guide to know how to migrate from FCM Legacy API to FCM HTTP v1 API.
Q. How do I handle 403: Permission_denied error?
A. If you encounter failure reason: 403 :: PERMISSION_DENIED :: Firebase Cloud Messaging API has not been used in the project before or it is disabled
, ensure Firebase Cloud Messaging API is enabled for your project.
- Visit console.cloud.google.comand navigate to API & services.
- Locate the Firebase Cloud Messaging API and enable it. Refer to pre-requisites to view the detailed steps.
Q. Do I need to upgrade the Netcore app SDK to migrate to FCM HTTP v1 API?
A. Netcore SDK upgrade is not required for migrating to FCM HTTP v1 API. You must upload the FCM Project ID and Private Key JSON to the Netcore CE dashboard. Refer to the migration document for more details.
Q. What happens if I don’t migrate before 20th July 2024?
A. After this deadline, your push notifications will not get delivered via legacy API; instead, they will result in an error.
Q. How does the new FCM API rate limit impact push notification delivery rates?
A. The FCM HTTP v1 API allows 600,000 tokens per 1-minute bucket, replenishing at the end of each 1-minute interval. Failure to comply with this rate limit may result in push notifications not being delivered to users and instead resulting in errors. Such failure will also trigger a non-compliance email from the FCM support team.
Netcore will retry such failed requests when an error related to the rate limit is exceeded is encountered. After ten retries, if the request fails, such notification will be marked as failed in the reports. However, we request that you spread out campaigns over a longer duration or do segment-based campaigns.
Q. Can the rate limit for my account be increased?
A. As mentioned in the official FCM documentation, contact Firebase Support to request an increase in the rate limit.
Updated 3 months ago