Methods reference

Types
// Contains the extended startup configuration for the library.
type AppMetricaConfig = {
  apiKey: string,
  appVersion?: string,
  crashReporting?: boolean,
  firstActivationAsUpdate?: boolean,
  location: Location,
  locationTracking?: boolean,
  logs?: boolean,
  sessionTimeout?: number,
  statisticsSending?: boolean,
  preloadInfo?: PreloadInfo,
  // Android only.
  installedAppCollecting?: boolean,
  maxReportsInDatabaseCount?: number,
  nativeCrashReporting?: boolean,
  // iOS only.
  activationAsSessionStart?: boolean,
  sessionsAutoTracking?: boolean,
}

// Contains information for tracking pre-installed apps.
type PreloadInfo = {
  trackingId: string,
  additionalInfo?: Object,
}

// Contains information about the location of the device.
type Location = {
  latitude: number,
  longitude: number,
  altitude?: number,
  accuracy?: number,
  course?: number,
  speed?: number,
  timestamp?: number
}

// Contains possible error reasons for the requestAppMetricaDeviceID() method.
type AppMetricaDeviceIdReason = 'UNKNOWN' | 'NETWORK' | 'INVALID_RESPONSE';
Methods
// Initializes the library in an application with the extended startup configuration.
activate(config: AppM