Migrate from legacy FCM APIs to HTTP v1

Migrate from legacy FCM APIs to HTTP v1

Apps using the deprecated FCM legacy APIs for HTTP and XMPP should migrate to the HTTP v1 API at the earliest opportunity. Sending messages (including upstream messages) with those APIs was deprecated on June 20, 2023, and will be removed in June 2024.

In addition to ongoing support and new features, the HTTP v1 API has these advantages over the legacy APIs:

  • Better security via access tokens The HTTP v1 API uses short-lived access tokens according to the OAuth2 security model. In the event that an access token becomes public, it can only be maliciously used for an hour or so before it expires. Refresh tokens are not transmitted as often as the security keys used in the legacy API, so they are much less likely to be captured.

  • More efficient customization of messages across platforms For the message body, the HTTP v1 API has common keys that go to all targeted instances, plus platform-specific keys that let you customize the message across platforms. This allows you to create "overrides" that send slightly different payloads to different client platforms in a single message.

  • More extendable and future-proof for new client platform versions The HTTP v1 API fully supports messaging options available on Apple platforms, Android and Web. Since each platform has its own defined block in the JSON payload, FCM can extend the API to new versions and new platforms as needed.


To retrieve the Sender ID and Server Key for your Android App from the Dengage Platform, follow these steps:

Retrieve Sender ID and Server Key from Dengage Platform:

1. Login to Dengage Account:
   - Open your web browser and log in to your Dengage account using your credentials.

2. Go to Your App's Dashboard:
   - Once logged in, navigate to your app's dashboard by selecting it from the list of apps associated with your account.

3. Access Android App Settings:
   - In the app dashboard, look for the Settings menu. It might be represented by a gear icon or labeled as "Settings."
   - Under Settings, go to Applications and select your Android app from the list of applications associated with your Dengage account.

4. Find Push Notifications Section:
   - After selecting your Android app, scroll down or navigate through the settings until you find the PUSH NOTIFICATIONS section.
   - Within this section, you should see the fields for Sender ID and Server Key. These are the values you'll need for Firebase Cloud Messaging (FCM) integration.

Once you have retrieved the Sender ID and Server Key from the Dengage Platform, you can use these values to configure Firebase Cloud Messaging (FCM) for your Android app as described in the previous steps or integrate them into your app's code for handling push notifications.



Ensure Firebase Cloud Messaging API (V1) is Enabled

Alright, to make sure you've got the Cloud Messaging API (V1) enabled for your Firebase project, follow these steps:

1. Go to the Firebase console and select your project.
2. Look for the gear icon, usually located next to "Project Overview" in the top left corner of the left-hand menu.
3. Click on the gear icon to open the Project settings.
4. In the Project settings, navigate to the "Cloud Messaging" tab.

5. Check if the Cloud Messaging API (V1) is enabled. If it's not enabled, you'll see an option to enable it.

If you find that Cloud Messaging API (V1) is not enabled, go ahead and enable it to ensure that your Firebase Cloud Messaging (FCM) functionality works correctly.

Remember, if you've just created a new Firebase project, this should already be enabled by default, so you can skip this step. But it's always good to double-check, especially with older or existing projects.



If the Firebase Cloud Messaging API (V1) is disabled, you can enable it by following these steps:
1. In the "Cloud Messaging" tab where you found that the API is disabled, look for the kebab menu icon (three vertical dots) usually located on the top right corner of the screen.
2. Click on the kebab menu icon to open a dropdown menu.
3. From the dropdown menu, you should see an option to enable the Cloud Messaging API (V1). Click on it to enable the API.
4. After enabling the API, you might need to configure some settings or credentials depending on your project's requirements. Follow any on-screen instructions or prompts to complete the setup.
Once you've enabled the Cloud Messaging API (V1) and completed any necessary configurations, you should be good to go with Firebase Cloud Messaging for your project!




Generating a private key JSON file for your Firebase project's service account is essential for server-side authentication and accessing Firebase services programmatically. Here's how you can generate a private key JSON file:

1. Navigate to Project Settings:
   - Go to the Firebase console and select your project.
   - Look for the gear icon next to "Project Overview" in the top left corner of the left-hand menu.
   - Click on the gear icon to open the Project settings.

2. Go to Service Accounts Tab:
   - In the Project settings, click on the "Service accounts" tab. This tab is usually located alongside other tabs like "Cloud Messaging," "General," etc.

3. Generate New Private Key:
   - Scroll down to the bottom of the "Service accounts" page.
   - You'll find an option that says "Generate new private key." Click on this button.

4. Download the Private Key JSON File:
   - After clicking "Generate new private key," a dialog or prompt will appear.
   - Confirm the action to generate a new private key.
   - Once confirmed, a JSON file containing the private key will be generated and downloaded to your computer.

Important: Keep this JSON file secure and do not expose it publicly. It contains sensitive information that allows access to your Firebase project's resources. If you're using this key in a production environment, make sure to store it securely and never commit it to public repositories or share it openly.

After generating the private key JSON file, you can use it for server-side authentication, configuring Firebase Admin SDK, or any other server-side operations that require Firebase services.




Configuring your Dengage app's Android platform settings involves integrating the Firebase Cloud Messaging (FCM) service with Dengage for push notifications on Android devices. Below are the steps to configure your Dengage app's Android platform settings:

Prerequisites:

1. Make sure you have a Dengage account and have created an app.
2. Ensure that you have already set up Firebase Cloud Messaging (FCM) for your Android app as described earlier.

Steps to Configure Android Platform Settings in Dengage:

1. Login to Dengage Dashboard:
   - Log in to your Dengage account and navigate to your app's dashboard.

2. Select Your App:
   - From the dashboard, select the app for which you want to configure Android platform settings.
   - Settings > Applications > select the android app

3. Navigate to Android Settings:
   - Look for the "PUSH NOTIFICATIONS" section in the app dashboard.
   - Click on Edit button then fill sender id, server key and upload the JSON file.

4. Enter Firebase Cloud Messaging (FCM) Details:
   - You'll need to enter your Firebase Server Key and Firebase Sender ID (also known as Project Number).
     - Firebase Server Key: This can be found in your Firebase Console under Project settings > Cloud Messaging > Server key. Copy and paste this key into the appropriate field in Dengage.
     - Firebase Sender ID (Project Number): This is also available in Firebase Console under Project settings > Cloud Messaging > Sender ID. Enter this ID into the designated field in Dengage.

5. Upload Google Services JSON File:
   - You may also have an option to upload the `google-services.json` file generated by Firebase when you set up FCM for your Android app. This file contains configuration settings for your app, including the Firebase Server Key and Sender ID. Uploading this file can help automate some of the setup processes.
     - To upload the `google-services.json` file, navigate to the Android settings section in Dengage and look for an option to upload or integrate with Firebase. Follow the on-screen instructions to upload the file.

6. Save Settings:
   - After entering the Firebase details, save the settings to apply the changes.

7. Test Configuration:
   - After saving the settings, it's a good idea to test the configuration to ensure that push notifications are working correctly on Android devices. You can send a test notification from Dengage to your app or use Firebase Console to send a test message to verify the setup.

Additional Settings:

- Notification Icons and Styles:
  - In Dengage, you may also have options to customize notification icons, styles, and other appearance settings for Android notifications. Configure these settings according to your app's branding and design guidelines.

- Deep Linking and Additional Payloads:
  - If you want to implement deep linking or handle additional data payloads in your notifications, make sure to configure the necessary settings and handle the data appropriately in your Android app code.



By following these steps and configuring the required settings in Dengage for your Android app, you should be able to successfully integrate Firebase Cloud Messaging (FCM) with Dengage for push notifications on Android devices. Make sure to test the setup thoroughly to ensure that notifications are delivered correctly to your app.


Noted! Here are some key points to keep in mind when setting up and sending push notifications through Dengage:

Important Notes:

  1. No A/B Testing on Push Sends:

    • Avoid using A/B testing for push notifications. This ensures that all users receive the same notification message without any variations.
  2. Avoid Using Code Snippets:

    • Do not use code snippets or dynamic content in push sends. This ensures that the push notifications are consistent and avoid any potential issues or errors.
  3. Not a Silent Push:

    • Ensure that the push notifications are not configured as "Silent Push." Silent pushes are notifications that do not display a message to the user but perform background tasks. For regular notifications, make sure to include a visible message or content.
  4. No Hourly Capping:

    • Avoid setting an hourly capping limit for push notifications. Hourly capping limits the number of notifications sent to users within a specific hour. Without this limit, notifications can be delivered as per the user's device settings and without restrictions.



    • Related Articles

    • API User List

      You can manage the API users registered on your account on this page. An account can own more than one API user. Also, you can manage current API users' authorities as well. Important Points The password is not changeable. (You should store this ...
    • Germany DC - DNS Records

      To define a customized sender address to your D·engage account some DNS records are required. These records are using to verify your sender address. We recommend to use a character (e.yourdomain.com, l.yourdomain.com, etc…) for subdomain instead of ...
    • Türkiye DC - DNS Records

      To define a customized sender address to your D·engage account some DNS records are required. These records are using to verify your sender address. We recommend to use a character (e.yourdomain.com, l.yourdomain.com, etc…) for subdomain instead of ...
    • Russia DC - DNS settings

      To define a customized sender address to your D·engage account some DNS records are required. These records are using to verify your sender address. We recommend to use a character (e.yourdomain.com, l.yourdomain.com, etc…) for subdomain instead of ...
    • Singapore DC - DNS Records

      To define a customized sender address to your D·engage account some DNS records are required. These records are using to verify your sender address. We recommend to use a character (e.yourdomain.com, l.yourdomain.com, etc…) for subdomain instead of ...