Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix auto source attribution

Neeraj Gupta11e2b3c52a70
diff --git a/mobile/apps/photos/android/app/src/main/kotlin/io/ente/photos/InstallSourceEventStore.kt b/mobile/apps/photos/android/app/src/main/kotlin/io/ente/photos/InstallSourceEventStore.kt
index 64c5e932b2..4179f6356b 100644
--- a/mobile/apps/photos/android/app/src/main/kotlin/io/ente/photos/InstallSourceEventStore.kt
+++ b/mobile/apps/photos/android/app/src/main/kotlin/io/ente/photos/InstallSourceEventStore.kt
@@ -9,6 +9,11 @@ data class InstallSource(
val referrerParams: Map<String, String>,
) {
val hasReferrer: Boolean get() = referrerParams.isNotEmpty()
+ val hasNonOrganicReferrer: Boolean
+ get() = hasReferrer && !(
+ referrerParams["utm_source"] == "google-play" &&
+ referrerParams["utm_medium"] == "organic"
+ )
}
class InstallSourceEventStore(private val context: Context) {
diff --git a/mobile/apps/photos/android/app/src/playstore/kotlin/io/ente/photos/InstallSourceProvider.kt b/mobile/apps/photos/android/app/src/playstore/kotlin/io/ente/photos/InstallSourceProvider.kt
index 023902d1de..9025c18b7f 100644
--- a/mobile/apps/photos/android/app/src/playstore/kotlin/io/ente/photos/InstallSourceProvider.kt
+++ b/mobile/apps/photos/android/app/src/playstore/kotlin/io/ente/photos/InstallSourceProvider.kt
@@ -18,7 +18,7 @@ class InstallSourceProvider(private val context: Context) {
fun hasInstallSource(result: MethodChannel.Result) {
getInstallSource { source ->
- result.success(source?.hasReferrer == true)
+ result.success(source?.hasNonOrganicReferrer == true)
}
}