Commit 333468fb authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Avoids using a reserved name

parent 75382d39
......@@ -29,7 +29,7 @@ class AnswersAnalytics : Analytics {
override fun logScreenView(event: ScreenViewEvent) =
Answers.getInstance()
.logCustom(CustomEvent("screen_view").putCustomAttribute("screen", event.screenName))
.logCustom(CustomEvent("screen").putCustomAttribute("name", event.screenName))
override fun logMessageSent(event: SubscriptionTypeEvent, serverUrl: String) =
......@@ -83,25 +83,47 @@ class AnswersAnalytics : Analytics {
.putCustomAttribute("server", serverUrl)
)
override fun logMessageActionAddReaction() = Answers.getInstance().logCustom(CustomEvent("message_action_add_reaction"))
override fun logMessageActionAddReaction() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "reaction"))
override fun logMessageActionReply() = Answers.getInstance().logCustom(CustomEvent("message_action_reply"))
override fun logMessageActionReply() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "reply"))
override fun logMessageActionQuote() = Answers.getInstance().logCustom(CustomEvent("message_action_quote"))
override fun logMessageActionQuote() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "quote"))
override fun logMessageActionPermalink() = Answers.getInstance().logCustom(CustomEvent("message_action_permalink"))
override fun logMessageActionPermalink() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "permalink"))
override fun logMessageActionCopy() = Answers.getInstance().logCustom(CustomEvent("message_action_copy"))
override fun logMessageActionCopy() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "copy"))
override fun logMessageActionEdit() = Answers.getInstance().logCustom(CustomEvent("message_action_edit"))
override fun logMessageActionEdit() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "edit"))
override fun logMessageActionInfo() = Answers.getInstance().logCustom(CustomEvent("message_action_info"))
override fun logMessageActionInfo() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "info"))
override fun logMessageActionStar() = Answers.getInstance().logCustom(CustomEvent("message_action_star"))
override fun logMessageActionStar() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "star"))
override fun logMessageActionPin() = Answers.getInstance().logCustom(CustomEvent("message_action_pin"))
override fun logMessageActionPin() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "pin"))
override fun logMessageActionReport() = Answers.getInstance().logCustom(CustomEvent("message_action_report"))
override fun logMessageActionReport() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "report"))
override fun logMessageActionDelete() = Answers.getInstance().logCustom(CustomEvent("message_action_delete"))
override fun logMessageActionDelete() =
Answers.getInstance()
.logCustom(CustomEvent("message_action").putCustomAttribute("action", "delete"))
}
......@@ -27,8 +27,8 @@ class GoogleAnalyticsForFirebase @Inject constructor(val context: Context) :
}
override fun logScreenView(event: ScreenViewEvent) {
firebaseAnalytics.logEvent("screen_view", Bundle(1).apply {
putString("screen", event.screenName)
firebaseAnalytics.logEvent("screen", Bundle(1).apply {
putString("name", event.screenName)
})
}
......@@ -73,25 +73,69 @@ class GoogleAnalyticsForFirebase @Inject constructor(val context: Context) :
})
}
override fun logMessageActionAddReaction() = firebaseAnalytics.logEvent("message_action_add_reaction", null)
override fun logMessageActionAddReaction() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "reaction")
})
}
override fun logMessageActionReply() = firebaseAnalytics.logEvent("message_action_reply", null)
override fun logMessageActionReply() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "reply")
})
}
override fun logMessageActionQuote() = firebaseAnalytics.logEvent("message_action_quote", null)
override fun logMessageActionQuote() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "quote")
})
}
override fun logMessageActionPermalink() = firebaseAnalytics.logEvent("message_action_permalink", null)
override fun logMessageActionPermalink() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "permalink")
})
}
override fun logMessageActionCopy() = firebaseAnalytics.logEvent("message_action_copy", null)
override fun logMessageActionCopy() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "copy")
})
}
override fun logMessageActionEdit() = firebaseAnalytics.logEvent("message_action_edit", null)
override fun logMessageActionEdit() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "edit")
})
}
override fun logMessageActionInfo() = firebaseAnalytics.logEvent("message_action_info", null)
override fun logMessageActionInfo() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "info")
})
}
override fun logMessageActionStar() = firebaseAnalytics.logEvent("message_action_star", null)
override fun logMessageActionStar() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "star")
})
}
override fun logMessageActionPin() = firebaseAnalytics.logEvent("message_action_pin", null)
override fun logMessageActionPin() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "pin")
})
}
override fun logMessageActionReport() = firebaseAnalytics.logEvent("message_action_report", null)
override fun logMessageActionReport() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "report")
})
}
override fun logMessageActionDelete() = firebaseAnalytics.logEvent("message_action_delete", null)
override fun logMessageActionDelete() {
firebaseAnalytics.logEvent("message_action", Bundle(1).apply {
putString("action", "delete")
})
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment