From 52dc1ac39bfdc9f311df7bc9dc17be486a5c101f Mon Sep 17 00:00:00 2001 From: jacob-schmit <111902336+jacob-schmit@users.noreply.github.com> Date: Thu, 3 Aug 2023 11:40:01 -0400 Subject: [PATCH] Update README.md to include example for calling blackbox in coroutine --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index fe2c824..cc8bfe6 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,21 @@ To integrate into native apps: ``` val blackbox : String = FraudForceManager.getBlackbox(applicationContext) ``` +6. To generate the blackbox using a coroutine, declare the desired scope and call the getBlackbox(Context context) function on an instance of FraudForceManager. You can use the withContext(context: CoroutineContext) suspend function to utilize the blackbox data in another scope. + + Kotlin Coroutines Example + ``` + private val uiScope = CoroutineScope(Dispatchers.IO) + + uiScope.launch { + ... + val blackbox : String = FraudForceManager.getBlackbox(applicationContext) + withContext(Dispatchers.Main) { + ... + useBlackbox(blackbox) + } + } + ``` ## Integrating into Hybrid Apps