Slide 37
Slide 37 text
Bonus 2: Set Custom
Keys to Crashlytics
fun FirebaseCrashlytics.setCustomKeys(vararg pairs:
Pair) {
for ((key, value) in pairs) {
when (value) {
is Boolean -> setCustomKey(key, value)
is Double -> setCustomKey(key, value)
is Float -> setCustomKey(key, value)
is Int -> setCustomKey(key, value)
is Long -> setCustomKey(key, value)
is String -> setCustomKey(key, value)
else -> {
throw
IllegalArgumentException("Illegal value type for
key \"$key\"")
}
}
}
}