diff --git a/android/nativebrik/build.gradle.kts b/android/nativebrik/build.gradle.kts index 618d42b..945b8d1 100644 --- a/android/nativebrik/build.gradle.kts +++ b/android/nativebrik/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } group = "com.nativebrik" -version = "0.0.5" +version = "0.0.6" android { namespace = "com.nativebrik.sdk" diff --git a/android/nativebrik/src/main/java/com/nativebrik/sdk/data/container.kt b/android/nativebrik/src/main/java/com/nativebrik/sdk/data/container.kt index d3fc11a..f48c22c 100644 --- a/android/nativebrik/src/main/java/com/nativebrik/sdk/data/container.kt +++ b/android/nativebrik/src/main/java/com/nativebrik/sdk/data/container.kt @@ -115,6 +115,7 @@ internal class ContainerImpl( experimentId = experimentId, variantId = variantId )) + this.databaseRepository.appendExperimentHistory(experimentId) val componentId = extractComponentId(variant) ?: return Result.failure(NotFoundException()) val component = this.componentRepository.fetchComponent(experimentId, componentId).getOrElse { return Result.failure(it) @@ -139,6 +140,7 @@ internal class ContainerImpl( experimentId = experimentId, variantId = variantId )) + this.databaseRepository.appendExperimentHistory(experimentId) val componentId = extractComponentId(variant) ?: return Result.failure(NotFoundException()) val component = this.componentRepository.fetchComponent(experimentId, componentId).getOrElse { return Result.failure(it) @@ -158,6 +160,7 @@ internal class ContainerImpl( experimentId = experimentId, variantId = variantId )) + this.databaseRepository.appendExperimentHistory(experimentId) return Result.success(variant) } diff --git a/android/nativebrik/src/main/java/com/nativebrik/sdk/data/httprequest.kt b/android/nativebrik/src/main/java/com/nativebrik/sdk/data/httprequest.kt index 3b483db..2b5b12a 100644 --- a/android/nativebrik/src/main/java/com/nativebrik/sdk/data/httprequest.kt +++ b/android/nativebrik/src/main/java/com/nativebrik/sdk/data/httprequest.kt @@ -25,6 +25,10 @@ internal class HttpRequestRepositoryImpl(): HttpRequestRepository { val body = req.body ?: "" setBody(connection, body) } + req.headers?.forEach { header -> + val name = header.name ?: return@forEach + connection.setRequestProperty(name, header.value ?: "") + } val response: String = connectAndGetResponse(connection).getOrElse { return@withContext Result.failure(it) diff --git a/android/nativebrik/src/main/java/com/nativebrik/sdk/sdk.kt b/android/nativebrik/src/main/java/com/nativebrik/sdk/sdk.kt index b007816..aba7ad6 100644 --- a/android/nativebrik/src/main/java/com/nativebrik/sdk/sdk.kt +++ b/android/nativebrik/src/main/java/com/nativebrik/sdk/sdk.kt @@ -23,7 +23,7 @@ import com.nativebrik.sdk.data.user.NativebrikUser import com.nativebrik.sdk.remoteconfig.RemoteConfigLoadingState import com.nativebrik.sdk.schema.UIBlock -const val VERSION = "0.0.5" +const val VERSION = "0.0.6" data class Endpoint( val cdn: String = "https://cdn.nativebrik.com",