Skip to content

Commit

Permalink
Update README.md to include example for calling blackbox in coroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-schmit authored Aug 3, 2023
1 parent 96b7750 commit 52dc1ac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52dc1ac

Please sign in to comment.