init method

Future<bool> init(
  1. int memberId, {
  2. int? publisherId,
  3. bool testMode = false,
})

Initializes the Xandr SDK.

memberId is the Xandr member ID. publisherId is the optional Xandr publisher ID. set testMode to true if in a test environment

Implementation

Future<bool> init(
  int memberId, {
  int? publisherId,
  bool testMode = false,
}) async {
  debugPrint(
    'init xandr with memberId=$memberId, publisherId=$publisherId, '
    'testMode=$testMode',
  );
  if (isInitialized.isCompleted) {
    return isInitialized.future;
  }
  final result = await _platform.init(
    memberId,
    publisherId: publisherId,
    testMode: testMode,
  );
  isInitialized.complete(result);
  return result;
}