Implementation of the article: Cross-Platform Analytics Made Easy with KMM
├── kmm-shared-library/ # KMM shared module
├── native-android-app/ # Android application
└── native-ios-app/ # iOS application
cd kmm-shared-library
./gradlew build
./gradlew :shared:assembleRelease # Creates .aarcd native-android-app
# Open in Android Studio
# Run ▶️cd native-ios-app
# Open in Xcode
# Run ▶️The shared library provides:
AnalyticAttribute- Centralized attribute keysAnalyticEvent- Sealed class with event typesAnalyticFactory- Factory methods for creating eventsgetAnalyticAttributes()- Converts events to HashMap
Both Android and iOS apps consume the shared library and send events through their native implementations.