How to use it:
The sdk entry point is the MacaoApplication
composable function. This function
expects the parameter MacaoApplicationState
. This class will hold the state of the
whole Application. It is the root state holder. It will contain the the pluginManager
passed from each platform. This PluginManager contains actual implementations of expected
abstracted functionalities.
// Android
class MainActivity : ComponentActivity() {
val startupTasks = listOf(
DatabaseMigrationStartupTask(),
LaunchDarklyStartupTask(),
SdkXyzStartupTask()
)
private val macaoApplicationState = MacaoApplicationState(
pluginManagerInitializer = AndroidPluginManagerInitializer(this),
startupTaskRunner = StartupTaskRunnerDefault(startupTasks),
rootComponentInitializer = DemoRootComponentInitializer()
)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MaterialTheme {
MacaoApplication(
applicationState = macaoApplicationState
)
}
}
}
}