For #981 - mma docs
parent
f323c38be0
commit
45b096c84f
|
@ -11,6 +11,7 @@ import com.leanplum.annotations.Parser
|
||||||
import com.leanplum.internal.LeanplumInternal
|
import com.leanplum.internal.LeanplumInternal
|
||||||
import org.mozilla.fenix.BuildConfig
|
import org.mozilla.fenix.BuildConfig
|
||||||
import org.mozilla.fenix.utils.Settings
|
import org.mozilla.fenix.utils.Settings
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
private val Event.name: String?
|
private val Event.name: String?
|
||||||
get() = when (this) {
|
get() = when (this) {
|
||||||
|
@ -57,11 +58,18 @@ class LeanplumMetricsService(private val application: Application) : MetricsServ
|
||||||
|
|
||||||
Leanplum.setIsTestModeEnabled(false)
|
Leanplum.setIsTestModeEnabled(false)
|
||||||
Leanplum.setApplicationContext(application)
|
Leanplum.setApplicationContext(application)
|
||||||
|
Leanplum.setDeviceId(UUID.randomUUID().toString())
|
||||||
Parser.parseVariables(application)
|
Parser.parseVariables(application)
|
||||||
|
|
||||||
LeanplumActivityHelper.enableLifecycleCallbacks(application)
|
LeanplumActivityHelper.enableLifecycleCallbacks(application)
|
||||||
|
|
||||||
|
val installedApps = MozillaProductDetector.getInstalledMozillaProducts(application)
|
||||||
|
|
||||||
Leanplum.start(application, hashMapOf(
|
Leanplum.start(application, hashMapOf(
|
||||||
"default_browser" to (MozillaProductDetector.getMozillaBrowserDefault(application) ?: "")
|
"default_browser" to (MozillaProductDetector.getMozillaBrowserDefault(application) ?: ""),
|
||||||
|
"fennec_installed" to installedApps.contains(MozillaProductDetector.MozillaProducts.FIREFOX.productName),
|
||||||
|
"focus_installed" to installedApps.contains(MozillaProductDetector.MozillaProducts.FOCUS.productName),
|
||||||
|
"klar_installed" to installedApps.contains(MozillaProductDetector.MozillaProducts.KLAR.productName)
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ object MozillaProductDetector {
|
||||||
REFERENCE_BROWSER_DEBUG("org.mozilla.reference.browser.debug"),
|
REFERENCE_BROWSER_DEBUG("org.mozilla.reference.browser.debug"),
|
||||||
FENIX("org.mozilla.fenix"),
|
FENIX("org.mozilla.fenix"),
|
||||||
FOCUS("org.mozilla.focus"),
|
FOCUS("org.mozilla.focus"),
|
||||||
|
KLAR("org.mozilla.klar"),
|
||||||
|
|
||||||
// Other products
|
// Other products
|
||||||
LOCKWISE("mozilla.lockbox")
|
LOCKWISE("mozilla.lockbox")
|
||||||
|
|
63
docs/mma.md
63
docs/mma.md
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue