NubrickSDK
定義
object NubrickSDK {
fun initialize(
context: Context,
config: Config
)
fun createConfig(
projectId: String,
onEventListener: NubrickGlobalEventListener? = null,
onDispatchListener: NubrickDispatchListener? = null,
trackCrashes: Boolean = true
): Config
fun dispatch(event: NubrickEvent)
fun setUserId(id: String)
fun getUserId(): String?
fun setUserProperty(key: String, value: Any)
fun getUserProperty(key: String): String?
fun setUserProperties(props: Map<String, Any>)
fun getUserProperties(): Map<String, String>
@Composable
fun Embedding(
id: String,
modifier: Modifier = Modifier,
arguments: Any? = null,
onEvent: ((event: Event) -> Unit)? = null,
content: (@Composable (state: EmbeddingLoadingState) -> Unit)? = null,
onSizeChange: ((width: NubrickSize, height: NubrickSize) -> Unit)? = null
)
@Composable
fun RemoteConfig(
id: String,
content: @Composable (RemoteConfigLoadingState) -> Unit
)
fun remoteConfig(id: String): Result<app.nubrick.nubrick.remoteconfig.RemoteConfig>
fun fetchRemoteConfig(
id: String,
listener: RemoteConfigListener
)
}
data class Config(
val projectId: String,
val onEvent: ((event: Event) -> Unit)? = null,
val onDispatch: ((event: NubrickEvent) -> Unit)? = null,
val trackCrashes: Boolean = true,
)
sealed class NubrickSize {
data class Fixed(val value: Int) : NubrickSize()
data object Fill : NubrickSize()
}
fun interface NubrickSizeListener {
fun onSizeChange(width: NubrickSize, height: NubrickSize)
}初期化
Kotlin / Compose
Java / XML
イベント送信
埋め込み(Compose)
埋め込み(Java / XML)
埋め込みサイズ
Kotlin / Compose
Java / XML
Remote Config
Kotlin / Compose
Java
ユーザープロパティ
Kotlin
Java
ビルトインのユーザープロパティ
Key
Description
補足
Last updated