👻 Multiplatform SDK is an SDk built in Kotlin Multiplatform(ui Compose Multiplatform) targeting Android And iOS.
classMainActivity : ComponentActivity() {
//Sdk Entry point from Androidval sdkLauncher =AndroidSdkLauncher(this)
val mySdk =MySdk(sdkLauncher)
overridefunonCreate(savedInstanceState:Bundle?) {
super.onCreate(savedInstanceState)
setContent {
AppTheme {
Column(modifier =Modifier.fillMaxSize()) {
Button(modifier =Modifier.padding(top =16.dp),
onClick = {
try {
mySdk.launch()
}catch (e:Exception){
println("Error occured;;;;"+ e)
}
// Launch the SDK
}) {
Text("Open SDK")
}
}
}
}
}
overridefunonResume() {
super.onResume()
}
}
structContentView:View{
// Sdk Entry point from iOS
varbody:someView{VStack{Text("Welcome to the Host App")Button("Open SDK"){openSdk()}}}privatefunc openSdk(){iflet rootViewController =UIApplication.shared.windows.first?.rootViewController {letsdkLauncher=IOSSdkLauncher(rootViewController: rootViewController)
sdkLauncher.openSdkApp()}}}