Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7b0c1f0 authored by Moez Bhatti's avatar Moez Bhatti
Browse files

Remove Mixpanel

parent 32f205c8
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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 {
@@ -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 {
+0 −11
Original line number Diff line number Diff line
@@ -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
@@ -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)
@@ -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) {