AppFit constructor
- {required AppFitConfiguration configuration,
- EventDigester? eventDigester}
Initializes the AppFit SDK with the provided configuration and optional
eventDigester for testing purposes.
Implementation
AppFit({
required this.configuration,
EventDigester? eventDigester,
}) : eventDigester = eventDigester ??
EventDigester(
apiKey: configuration.apiKey,
appVersion: configuration.appVersion,
enableIpTracking: configuration.enableIpTracking,
) {
// Once we boot up the AppFit SDK, we need to generate an anonymousId
// and set the userId to null. This is to ensure that we have the most
// up-to-date information for the events.
this.eventDigester.identify(null);
// This is a unique event that is used specifically to track when the
// AppFit SDK has been initialized.
// This is an internal event.
trackEvent("appfit_sdk_initialized");
}