Skip to content

Commit

Permalink
Merge pull request #47 from plaidev/flutter
Browse files Browse the repository at this point in the history
[android] use N_ERROR_RECORD instead of hard coded string
  • Loading branch information
RyosukeCla authored Jun 26, 2024
2 parents 1e1e653 + e3e8cfd commit 5606eda
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion android/nativebrik/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "com.nativebrik"
version = "0.1.4"
version = "0.1.5"

android {
namespace = "com.nativebrik.sdk"
Expand Down
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
2 changes: 1 addition & 1 deletion android/nativebrik/src/main/java/com/nativebrik/sdk/sdk.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import com.nativebrik.sdk.data.user.NativebrikUser
import com.nativebrik.sdk.remoteconfig.RemoteConfigLoadingState
import com.nativebrik.sdk.schema.UIBlock

const val VERSION = "0.1.4"
const val VERSION = "0.1.5"

data class Endpoint(
val cdn: String = "https://cdn.nativebrik.com",
Expand Down

0 comments on commit 5606eda

Please sign in to comment.