[MWA-5012] MetaPlugin-Integration-Demo aktualisieren {fix CR}
This commit is contained in:
parent
4df2b05b70
commit
183eb583eb
@ -5,6 +5,7 @@
|
||||
package de.webidsolutions.metaplugindemo
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.widget.Button
|
||||
import android.widget.CheckBox
|
||||
@ -22,7 +23,11 @@ import de.webidsolutions.mobile_app.sdk.WebIdSdkEnvironment
|
||||
import de.webidsolutions.mobile_app.sdk.domain.VerifyActionIdResult
|
||||
import de.webidsolutions.mobile_app.sdk.impl.AsyncTaskResultGeneric
|
||||
import de.webidsolutions.pay_on_server_product_plugin.PayOnServerProductPlugin
|
||||
import de.webidsolutions.plugin_core.IEPluginError
|
||||
import de.webidsolutions.plugin_core.IProductPluginWebId
|
||||
import de.webidsolutions.plugin_core.ProductPluginErrorResult
|
||||
import de.webidsolutions.plugin_core.ProductPluginResult
|
||||
import de.webidsolutions.plugin_core.WebIdPluginInterruptedException
|
||||
import de.webidsolutions.video_ident.plugin.videocall.VideoOptionsConfig
|
||||
import de.webidsolutions.video_ident_product_plugin.VideoIdentProductPlugin
|
||||
import java.lang.Integer.parseInt
|
||||
@ -165,14 +170,38 @@ internal class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun onPluginResultCallback(result: ActivityResult?) {
|
||||
var metaPluginActivityResult = result
|
||||
|
||||
private fun onPluginResultCallback(activityResult: ActivityResult) {
|
||||
var result = ""
|
||||
try {
|
||||
val data: Intent = activityResult.data ?: throw WebIdPluginInterruptedException()
|
||||
val pluginResult: ProductPluginResult<*> =
|
||||
IProductPluginWebId.getProductPluginResult<IEPluginError>(
|
||||
data, activityResult.resultCode
|
||||
)
|
||||
val resultInfo: String? = pluginResult.info
|
||||
val failReason: ProductPluginErrorResult<*>? = pluginResult.error
|
||||
// success
|
||||
if (failReason == null) {
|
||||
result = "Success"
|
||||
if (resultInfo != null) {
|
||||
result += " $resultInfo"
|
||||
}
|
||||
} else {
|
||||
// failure case
|
||||
if (failReason.specificResult != null) {
|
||||
val specificResult: IEPluginError? =
|
||||
failReason.specificResult as IEPluginError?
|
||||
result = specificResult.toString()
|
||||
} else if (failReason.genericResult != null) {
|
||||
result = failReason.genericResult.toString()
|
||||
}
|
||||
}
|
||||
} catch (e: WebIdPluginInterruptedException) {
|
||||
writeLog(e.toString())
|
||||
}
|
||||
writeLog(result)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* MISC */
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user