Repository navigation
π Analytics: restore UI events, Firebase Analytics on iOS - #29
Merged
Merged
Conversation
added 4 commits
October 3, 2026 02:29
Since the KMP migration nothing provided LocalAnalyticsHelper, so every event logged from the UI (screen views, opened stations, news and careers, language changes) went to its NoOpAnalyticsHelper default; only data-layer and sync events reached Firebase. MetanMobileApp now provides the Koin AnalyticsHelper at the root, as MainActivity did. Also restores the Cabinet screen view, lost in the migration.
iOS logged nothing (NoOpAnalyticsHelper). The shared code's events now go to Firebase Analytics, the same project as Android, so both platforms report the same events. - core:analytics: AnalyticsBridge, implemented in Swift, and BridgedAnalyticsHelper, which truncates params to Firebase's limits like Android's FirebaseAnalyticsHelper; exported in the framework. - initSharedKoin takes the bridge; FirebaseAnalyticsBridge and FirebaseApp.configure() in MetanMobileApp.swift. - Xcode: firebase-ios-sdk (FirebaseAnalytics) on the app target. - GoogleService-Info.plist is gitignored like google-services.json: put it in iosApp/MetanMobileApp/ to build the app. Tests: BridgedAnalyticsHelper (JVM + iOS simulator).
macos-latest only has Xcode 26.x, so setup-xcode failed with "Could not find Xcode version that satisfied version spec: '27'". Xcode 27 is on the xcode-27 preview image (actions/runner-images#14404).
iOS syncs didn't log network_sync_started / _successful / _failed; Android's SyncWorker did. The event helpers move to sync:work's commonMain and both iOS sync paths log them per attempt, like each SyncWorker run: IosSyncManager (launch/foreground sync, with retries) and the BGTaskScheduler background refresh.
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.
Summary
π Analytics UI events were never sent
LocalAnalyticsHelper, so every event logged from the UI (screen views, opened stations, news and careers, language changes) went to itsNoOpAnalyticsHelperdefault. Only data-layer and sync events reached Firebase.MetanMobileAppnow provides the KoinAnalyticsHelperat the root, as the oldMainActivitydid.β¨ Firebase Analytics on iOS
NoOpAnalyticsHelper). The shared code's events now go to Firebase Analytics, the same project as Android, so both platforms report the same events.core:analytics:AnalyticsBridge(implemented in Swift) andBridgedAnalyticsHelper, which truncates params to Firebase's limits like Android'sFirebaseAnalyticsHelper; exported in the framework.initSharedKointakes the bridge;FirebaseAnalyticsBridgeandFirebaseApp.configure()inMetanMobileApp.swift.firebase-ios-sdk(FirebaseAnalytics) on the app target.network_sync_started/_successful/_failed) on iOS too: the helpers move tosync:work's commonMain;IosSyncManager(per attempt) and the BGTaskScheduler refresh log them, like Android'sSyncWorker.βοΈ CI: iOS on the xcode-27 image
macos-latestonly has Xcode 26.x, so the iOS job failed with "Could not find Xcode version that satisfied version spec: '27'". It now runs on thexcode-27preview image ([macOS] Xcode 27 is now available as a public previewΒ actions/runner-images#14404); switch back oncemacos-latestships Xcode 27.Review notes
GoogleService-Info.plistis gitignored likegoogle-services.json: put it iniosApp/MetanMobileApp/to build the app. CI doesn't build the app target, so it's unaffected.screen_viewwith screen names (HomeScreen,StationDetailScreen); the iOS simulator registers with Firebase Installations and its local measurement DB countsscreen_viewgrowing while navigating andnetwork_sync_started/network_sync_successfulafter launch, with the upload queue emptying.com.ngapp.metanmobileonly (HTTP 403API_KEY_ANDROID_APP_BLOCKED). Release is fine. Fix in the console by addingcom.ngapp.metanmobile.debug+ the debug SHA-1 to the key's Android restrictions.BridgedAnalyticsHelperon the JVM and the iOS simulator.