This is an example of the most common use case of this SDK - fetching operations and approving them.
Follow the SDK Integration tutorial for SDK installation.
// PowerAuth instance needs to be configured and a user-activated instance.
// More about PowerAuth SDK can be found here: https://github.com/wultra/powerauth-mobile-sdk
fun exampleUsage(appContext: Context, powerAuth: PowerAuthSDK) {
// Create the WultraMobileToken instance
val wmt = powerAuth.createWultraMobileToken(appContext, acceptLanguage = "de")
// Fetch operations using a callback
wmt.operations.getOperations {
it.onSuccess { operations ->
// Handle operations
for (operation in operations) {
// Process each operation
}
}.onFailure { error ->
// Handle error
}
}
}
For more examples see IntegrationTests