Has anyone integrated Mixpanel analytics into thei...
# multiplatform
b
Has anyone integrated Mixpanel analytics into their Compose Multiplatform apps for Android and iOS? If so, how did you approach it? Any helpful resources like GitHub repos, articles, or tutorials would be greatly appreciated!
h
Define a common interface Implement the interface in androidMain through gradle from Mixpanel's SDK Inside Swift implement the interface in your iosApp folder through SPM or Cocoapods Provide the implementation object's interface through DI Resolve the interface in your common code Voila I'm doing the same for Admob, Firebase remote config, analytics, In-app review, updates etc..m
plus1 2
👍 1
b
I was able to implement the interface on androidMain but I'm having challenges providing the iOS interface implementation in iosMain using Koin I can't be able to import the Swift IosAnalyticsImpl interface to iosMain since that is where I'm providing the implementation using Koin? Any help on how I can go about that
h
you can’t use iosMain this way, this will be implemented in the iosApp’s swift code, then from the AppDelegate init method you provide the objects to your koin graph and resolve them in the commonMain code
👍 2