Skip to content

Commit

Permalink
[android] sync, and use N_ERROR_RECORD instead of hard cording
Browse files Browse the repository at this point in the history
  • Loading branch information
RyosukeCla committed Jun 26, 2024
1 parent b49c30a commit b03338a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.nativebrik.sdk.data.user.formatISO8601
import com.nativebrik.sdk.data.user.getCurrentDate
import com.nativebrik.sdk.schema.ListDecoder
import com.nativebrik.sdk.schema.StringDecoder
import com.nativebrik.sdk.schema.TriggerEventNameDefs
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -200,12 +201,12 @@ internal class TrackRepositoryImpl: TrackRepository {
crashRecord.reason?.contains("com.nativebrik.sdk") == true

this.buffer.add(TrackEvent.UserEvent(TrackUserEvent(
name = "N_CRASH_RECORD"
name = TriggerEventNameDefs.N_ERROR_RECORD.name
)))

if (causedByNativebrik) {
buffer.add(TrackEvent.UserEvent(TrackUserEvent(
name = "N_CRASH_IN_SDK_RECORD"
name = TriggerEventNameDefs.N_ERROR_IN_SDK_RECORD.name
)))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,8 @@ internal enum class TriggerEventNameDefs {
USER_ENTER_TO_APP,
USER_ENTER_TO_APP_FIRSTLY,
USER_ENTER_TO_FOREGROUND,
N_ERROR_RECORD,
N_ERROR_IN_SDK_RECORD,
UNKNOWN,;

companion object {
Expand All @@ -1179,6 +1181,8 @@ internal enum class TriggerEventNameDefs {
"USER_ENTER_TO_APP" -> USER_ENTER_TO_APP
"USER_ENTER_TO_APP_FIRSTLY" -> USER_ENTER_TO_APP_FIRSTLY
"USER_ENTER_TO_FOREGROUND" -> USER_ENTER_TO_FOREGROUND
"N_ERROR_RECORD" -> N_ERROR_RECORD
"N_ERROR_IN_SDK_RECORD" -> N_ERROR_IN_SDK_RECORD
else -> UNKNOWN
}
}
Expand Down

0 comments on commit b03338a

Please sign in to comment.