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.
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:
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.
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.
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.
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.