Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
add background as a extra parameter to telemetry (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
proevan authored Oct 31, 2019
1 parent c2738e2 commit 57497ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void onReceive(Context context, Intent intent) {

String messageId = bundle.getString(IntentUtils.EXTRA_NOTIFICATION_MESSAGE_ID, "");
String link = bundle.getString(IntentUtils.EXTRA_NOTIFICATION_LINK, "");
TelemetryWrapper.openNotification(link, messageId);
TelemetryWrapper.openNotification(link, messageId, false);

} else if (bundle.getBoolean(IntentUtils.EXTRA_NOTIFICATION_ACTION_RATE_STAR)) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ object TelemetryWrapper {
const val TASK = "task"
const val FINISHED = "finished"
const val ITEM_NAME = "item_name"
const val BACKGROUND = "background"
}

object Extra_Value {
Expand Down Expand Up @@ -2501,13 +2502,15 @@ object TelemetryWrapper {
value = "",
extras = [
TelemetryExtra(name = Extra.LINK, value = "${Extra_Value.URL},${Extra_Value.DEEPLINK},null"),
TelemetryExtra(name = Extra.MESSAGE_ID, value = "messageId")
TelemetryExtra(name = Extra.MESSAGE_ID, value = "messageId"),
TelemetryExtra(name = Extra.BACKGROUND, value = "true|false")
])
@JvmStatic
fun openNotification(link: String?, messageId: String?) {
fun openNotification(link: String?, messageId: String?, background: Boolean) {
EventBuilder(Category.ACTION, Method.OPEN, Object.NOTIFICATION)
.extra(Extra.LINK, link ?: "null")
.extra(Extra.MESSAGE_ID, messageId ?: "null")
.extra(Extra.BACKGROUND, background.toString())
.queue()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class LaunchIntentDispatcher {
val isFromPush = pushMessageId != null
if (isFromPush) {
val link = parseLink(intent)
TelemetryWrapper.openNotification(link, pushMessageId)
TelemetryWrapper.openNotification(link, pushMessageId, true)
}
}

Expand Down

0 comments on commit 57497ec

Please sign in to comment.