initialize static method

Future<bool> initialize(
  1. BlueConicConfiguration configuration
)

Initializes the BlueConic SDK with the provided configuration asynchronously.

This method must be called before using any other BlueConic functionality. It establishes the connection to the BlueConic platform using the provided hostname and configuration options.

configuration The BlueConic configuration containing hostname and other settings Returns a Future<bool> that completes with true if initialization succeeds, or false if it fails

Implementation

static Future<bool> initialize(BlueConicConfiguration configuration) async {
  try {
    final result = await BlueConicPlatform.instance.initialize(
      configuration.toMap(),
    );
    if (result.success) {
      return true;
    } else {
      return false;
    }
  } catch (e) {
    return false;
  }
}