I've been trying to check if a featureFlag exists inside suspendCoroutine with runblocking but the resulting lambda doesn't execute. Something like the one below.
fun isWalletEnabled(): Boolean = runBlocking {
Log.d(TAG, "isWalletEnabled: starting")
suspendCoroutine { continuation ->
Log.d(TAG, "isWalletEnabled: suspending")
flagsmith.hasFeatureFlag("is_wallet_enabled") {
Log.d(TAG, "isWalletEnabled: resulting -> ${it.getOrNull()}")
continuation.resumeWith(Result.success(it.getOrNull() ?: false))
}
}
}
Interestingly if I run it outside the suspendCoroutine it works and runs the lambda.
fun isWalletEnabled(): Boolean = runBlocking {
Log.d(TAG, "isWalletEnabled: starting")
flagsmith.hasFeatureFlag("is_wallet_enabled") {
Log.d(TAG, "isWalletEnabled: resulting -> ${it.getOrNull()}")
}
true
}
Anyway I could solve this?
I've been trying to check if a featureFlag exists inside
suspendCoroutinewith runblocking but the resulting lambda doesn't execute. Something like the one below.Interestingly if I run it outside the
suspendCoroutineit works and runs the lambda.Anyway I could solve this?