Files
swiftcontrol/lib/utils/analytics
Jonas Bark 351bb4ca63 fix(attribution): guard install-referrer report on settings init + document reporter ctor
Add core.settings.isInitialized to the Android install-referrer gate in
main.dart. Settings._prefs is a late SharedPreferences assigned during
Settings.init(); if SharedPreferences.getInstance() throws, _prefs is
never assigned. The referrer block previously read core.settings.prefs
unconditionally, so that failure would raise a LateInitializationError
from inside the guarded zone before runApp(BikeControlApp(error: error))
ran, skipping the intended error screen. Gating on isInitialized (already
used the same way in click_v2_onboarding.dart) skips the block instead.

Also add a one-line doc comment to the InstallReferrerReporter
constructor describing its injected source/prefs/send collaborators, to
match the class-level doc comment already present.

No logic changes in install_referrer_parser.dart.
2026-08-17 08:06:35 +02:00
..