init static method

Future<void> init({
  1. required String adjustKey,
  2. bool? launchDeferredDeeplink,
})

Initialize DSAdjust adjustKey - API key of Adjust

Implementation

static Future<void> init({
  required String adjustKey,
  bool? launchDeferredDeeplink,
}) async {
  if (_isInitialized) {
    Fimber.e('DSAdjust is already initialised', stacktrace: StackTrace.current);
    return;
  }

  await DSConstants.I.waitForInit();
  final config = AdjustConfig(
      adjustKey, DSConstants.I.isInternalVersion ? AdjustEnvironment.sandbox : AdjustEnvironment.production);
  config.logLevel = AdjustLogLevel.verbose;
  config.attributionCallback = _setAdjustAttribution;
  config.isDeferredDeeplinkOpeningEnabled = launchDeferredDeeplink;
  Adjust.initSdk(config);

  _isInitialized = true;

  // init adid
  getAdid();

  for (final callback in _initCallbacks) {
    callback();
  }
}