initSdkIfNeeded

public final Unit initSdkIfNeeded(Activity activity, Function0<Unit> postInit)

A utility method that ensures that the SDK is initialized before running a lambda. It shows a loading dialog while the SDK is being initialized. The initialization is in a separate thread.

Parameters

activity

The activity to show the loading dialog in

postInit

The lambda to run after the SDK is initialized