create Virtual Id Screen Launcher
open override fun ComponentActivity.createVirtualIdScreenLauncher(callback: (VirtualIdScreenFinishReason) -> Unit): ActivityResultLauncher<LaunchParameters>
Creates and registers VirtualIdScreenContract which is necessary for launching ISIC Virtual ID screen.
It's not required to configure the SDK before calling this method, however it's necessary to configure the SDK before launching the screen via launcher returned by this method.
Return
androidx.activity.result.ActivityResultLauncher
Usage:
Add following import:
import org.isic.sdk.virtualid.IsicVirtualIdSdk.createVirtualIdScreenLauncher
Content copied to clipboard
Call following code as property on androidx.activity.ComponentActivity
val showVirtualIdLauncher = createVirtualIdScreenLauncher { /* Process result here */}
Content copied to clipboard
Once you want to show the screen, make sure the SDK was configured and then use following code to launch the screen:
showVirtualIdLauncher.launch(LaunchParameters( /* Provide launch parameters here */))
Content copied to clipboard
Parameters
callback
Callback providing result once the screen is closed. See VirtualIdScreenFinishReason