🐛 Mobile | Re-enable Firebase Analytics on iOS#1554
Open
jernejk wants to merge 1 commit into
Open
Conversation
The iOS branch of RegisterFirebase() never initialised analytics and the prod GoogleService-Info.plist ships with IS_ANALYTICS_ENABLED=false, so every LogEvent() call from iOS has been a silent no-op since PR #1212 (Mar 2025). Android is unaffected. Force-enable collection at runtime via Plugin.Firebase.Analytics so iOS sends quiz/reward/screen events to GA4 regardless of the plist flag. Matches the intent already expressed by the Android branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Re-enables Firebase Analytics event collection on iOS by explicitly enabling analytics at runtime during app startup, addressing the current “silent no-op” behavior caused by an iOS plist flag and missing iOS-side enablement.
Changes:
- Makes
Plugin.Firebase.Analyticsavailable for iOS by moving theusingdirective out of the Android-only preprocessor block. - Enables Firebase Analytics collection on iOS during
WillFinishLaunchingviaCrossFirebaseAnalytics.Current.IsAnalyticsCollectionEnabled = true;.
0xharkirat
approved these changes
Apr 24, 2026
0xharkirat
left a comment
Member
There was a problem hiding this comment.
LGTM - I am curious, will this be shipped immediately?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✏️ Today's production pulse report showed that iOS users are invisible to Firebase Analytics / GA4 — every
LogEvent()call from iOS has been a silent no-op since PR #1212 (Mar 2025). The iOS branch ofRegisterFirebase()never initialised analytics, and the prodGoogleService-Info.plistships withIS_ANALYTICS_ENABLED=false. Android has been fine throughout.Pulse report: https://ssw-rewards-prod-today-report-20260423.surge.sh
Verified empirically:
firebase apps:sdkconfig IOS ... --project ssw-rewards-52a58→IS_ANALYTICS_ENABLED=falsesrc/MobileUI/MauiProgram.cs(currentmain) only callsFirebaseAnalyticsImplementation.Initialize(activity)under#elif ANDROID. The#if IOSblock has no analytics init.SetAnalyticsCollectionEnabled, noFIREBASE_ANALYTICS_COLLECTION_ENABLEDinInfo.plist).✏️ Single-file change in
src/MobileUI/MauiProgram.cs:using Plugin.Firebase.Analytics;out of the#elif ANDROIDblock so iOS can use it too.WillFinishLaunchinglifecycle event:That property setter delegates to
FirebaseAnalytics.SetAnalyticsCollectionEnabled(true)under the hood (confirmed from Plugin.Firebase iOS source), which takes precedence over the plist flag at runtime. No need to regenerate the productionGoogleService-Info.plist— though it would still be good hygiene to do so separately so the plist reflects intent.Android is untouched — it already works via
FirebaseAnalyticsImplementation.Initialize(activity)+ manifest flag.Validation plan
quiz_start+reward_viewGoogleService-Info.plistfrom Firebase Console with analytics enabled, update the GitHub secret that release workflows inject from✏️ Paired with Claude Opus 4.7 (1M context) — investigation (git archaeology on PR #1212), Plugin.Firebase source reading, and the fix itself.