Skip to content

Commit

Permalink
Remove Mixpanel
Browse files Browse the repository at this point in the history
  • Loading branch information
moezbhatti committed Dec 12, 2020
1 parent 32f205c commit a7b0c1f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

buildConfigField "String", "AMPLITUDE_API_KEY", "\"${System.getenv("AMPLITUDE_API_KEY")}\""
buildConfigField "String", "MIXPANEL_API_KEY", "\"${System.getenv("MIXPANEL_API_KEY")}\""
}

productFlavors {
Expand Down Expand Up @@ -94,7 +93,6 @@ dependencies {
implementation project(':common')
implementation project(':domain')
withAnalyticsImplementation "com.amplitude:android-sdk:2.16.0"
withAnalyticsImplementation "com.mixpanel.android:mixpanel-android:5.2.1"
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import android.content.Context
import com.amplitude.api.Amplitude
import com.amplitude.api.AmplitudeClient
import com.amplitude.api.Identify
import com.mixpanel.android.mpmetrics.MixpanelAPI
import com.moez.QKSMS.data.BuildConfig
import org.json.JSONArray
import org.json.JSONObject
Expand All @@ -34,7 +33,6 @@ import javax.inject.Singleton
class AnalyticsManagerImpl @Inject constructor(context: Context) : AnalyticsManager {

private val amplitude: AmplitudeClient = Amplitude.getInstance().initialize(context, BuildConfig.AMPLITUDE_API_KEY)
private val mixpanel: MixpanelAPI = MixpanelAPI.getInstance(context, BuildConfig.MIXPANEL_API_KEY)

init {
amplitude.trackSessionEvents(true)
Expand All @@ -47,20 +45,11 @@ class AnalyticsManagerImpl @Inject constructor(context: Context) : AnalyticsMana
.also { Timber.v("$event: $it") }

amplitude.logEvent(event, propertiesJson)

synchronized(mixpanel) {
mixpanel.track(event, propertiesJson)
}
}

override fun setUserProperty(key: String, value: Any) {
Timber.v("$key: $value")

// Set the value in Mixpanel
val properties = JSONObject()
properties.put(key, value)
mixpanel.registerSuperProperties(properties)

// Set the value in Amplitude
val identify = Identify()
when (value) {
Expand Down

0 comments on commit a7b0c1f

Please sign in to comment.