Introduction #
Firebase powers push notifications and optional Google Analytics for your Learndash App. With Firebase, you can send native push notifications to Android and iOS users, and, if enabled, track user engagement through Analytics.
This guide explains how to:
- Create a Firebase project
- Register your iOS and Android apps
- Configure Cloud Messaging for push notifications
- (Optional) Enable Google Analytics
Creating a Firebase Project #
- Go to Firebase Console and click Sign in. Log in using your Google Workspace or Gmail account.
- Click Create project.
- Enter a Project name (e.g., My App) and click Continue.
- To enable Analytics, leave Enable Google Analytics for this project checked. To skip, uncheck it and click Continue.
- If Analytics is enabled, select an existing account or create a new one, then click Continue.
- Click Create project and wait for initialization.
- Click Continue to open your project’s dashboard.
Registering Your App #
iOS App Registration #
- In the Firebase project overview, click the iOS icon under Get started by adding Firebase to your app.
- Enter your iOS app’s Bundle ID (must match your Xcode project).
- (Optional) Enter an App nickname and App Store ID.
- Click Register app.
- Download the GoogleService-Info.plist file and add it to your Xcode project.
- Follow the CocoaPods integration instructions provided, then click Continue to console.
Android App Registration #
- Click the Android icon under Get started by adding Firebase to your app.
- Enter your Android Package name (e.g., com.yourdomain.app).
- (Optional) Add an App nickname and Debug signing certificate SHA-1.
- Click Register app.
- Download the google-services.json file and place it in your /app/ module directory.
- Add the Firebase SDK dependencies in your Gradle files as instructed, then click Continue to console.
Configuring Push Notifications #
- In Firebase Console, click the gear icon > Project settings.
- Select the Cloud Messaging tab.
For Android
- Copy the Server key and Sender ID.
For iOS (APNs)
- Under APNs certificates, click Upload.
- Upload your .p8 key file, enter the Key ID and your Team ID.
- Click Save.
(Optional) Enabling Google Analytics #
- In Firebase Console, go to Analytics > Dashboard to verify data collection.
- In WordPress Admin, navigate to Learndash App > Settings > Integrations > Firebase.
- Toggle on Enable Firebase Analytics, enter your Firebase Project ID, and click Save Changes.
Troubleshooting & FAQs #
Q: My APNs key upload failed.
A: In Apple Developer > Certificates, Identifiers & Profiles > Keys, create a key with Apple Push Notifications service (APNs) enabled, download the .p8 file, and retry the upload.
Q: Push notifications aren’t arriving on Android.
A: Check that your Server key and Sender ID in Learndash App > Settings > Push Notifications match those in Firebase.
Q: Firebase config file not found at runtime.
A: Ensure GoogleService-Info.plist is in your Xcode app bundle and google-services.json is placed in /app/ for Android and listed in your Gradle settings.
Q: I don’t see my app in Firebase Console.
A: Make sure the Bundle ID or Package name exactly matches your app settings; typos will block registration.