This directory contains configuration files and scripts for Firebase integration.
The GoogleService-Info.plist file contains sensitive API keys and is excluded from the repository for security reasons. The app gracefully handles missing Firebase configuration.
-
Copy the template file:
./Support/Scripts/setup-firebase.sh
Or manually:
cp Support/Scripts/GoogleService-Info-template.plist MacMagazine/MacMagazine/Resources/GoogleService-Info.plist
-
For Firebase Analytics (Optional):
- Replace placeholder values in
MacMagazine/MacMagazine/Resources/GoogleService-Info.plistwith real credentials - The file is gitignored and won't be committed
- If you keep placeholder values, Firebase will be automatically disabled
- Replace placeholder values in
-
Add to Xcode (One-time setup):
- Open
MacMagazine.xcodeprojin Xcode - Right-click
Resourcesfolder → "Add Files to MacMagazine..." - Select
GoogleService-Info.plistfrom Resources - Uncheck "Copy items if needed"
- Check "MacMagazine" target
- Commit the updated
project.pbxproj
- Open
-
Set environment variables in Bitrise:
- Go to Workflow Editor → Secrets
- Add the following secrets:
FIREBASE_API_KEYFIREBASE_GCM_SENDER_IDFIREBASE_PROJECT_IDFIREBASE_STORAGE_BUCKETFIREBASE_GOOGLE_APP_IDFIREBASE_BUNDLE_ID
-
Add script step BEFORE Xcode build:
- script@1: title: Generate Firebase Configuration inputs: - content: | #!/usr/bin/env bash set -ex ./Support/Scripts/generate-firebase-config.sh
-
Upload file to Bitrise:
- Navigate to Code Signing & Files → Generic File Storage
- Upload your
GoogleService-Info.plist - Note the environment variable (e.g.,
$BITRISEIO_GOOGLE_SERVICE_INFO_PLIST_URL)
-
Add script step BEFORE Xcode build:
- script@1: title: Download Firebase Configuration inputs: - content: | #!/usr/bin/env bash set -ex DEST="$BITRISE_SOURCE_DIR/MacMagazine/MacMagazine/Resources/GoogleService-Info.plist" if [ -n "$BITRISEIO_GOOGLE_SERVICE_INFO_PLIST_URL" ]; then echo "Downloading GoogleService-Info.plist..." curl -o "$DEST" "$BITRISEIO_GOOGLE_SERVICE_INFO_PLIST_URL" echo "✅ Downloaded successfully" else echo "⚠️ No Firebase config URL set" exit 1 fi
- Template: Stored in
Support/Scripts/GoogleService-Info-template.plist(safe to commit) - Local: Copy template to Resources, optionally replace with real credentials
- CI/CD: Generate from environment variables or download from secure storage
- Runtime: App checks if file exists and has valid credentials before initializing Firebase
- Safety: Missing or invalid config = app runs fine, Firebase disabled
- ✅ Template file is safe to commit (contains no real credentials)
- ✅ Real
GoogleService-Info.plistis gitignored - ✅ API keys stored as Bitrise secrets or secure file storage
- ✅ App gracefully handles missing configuration
- Run
./Support/Scripts/setup-firebase.shto create the config file - Ensure
GoogleService-Info.plistis added to Xcode project
- Verify environment variables are set (Option 1) OR file is uploaded (Option 2)
- Check script runs BEFORE Xcode build step
- Review build logs for generation/download errors
- Check file contains real credentials (not "YOUR_API_KEY_HERE")
- App will log why Firebase wasn't initialized