init static method
Initialize DSAdjust
adjustKey
- API key of Adjust
Implementation
static Future<void> init({
required String adjustKey,
bool? launchDeferredDeeplink,
bool? launchLinkMeEnabled,
DeferredDeeplinkCallback? deferredDeeplinkCallback,
}) 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;
config.deferredDeeplinkCallback = deferredDeeplinkCallback;
config.isLinkMeEnabled = launchLinkMeEnabled;
Adjust.initSdk(config);
_isInitialized = true;
// init adid
getAdid();
for (final callback in _initCallbacks) {
callback();
}
}