Include app version in metrics (#8699)
This commit is contained in:
@@ -8,6 +8,7 @@ import {logger} from '#/logger'
|
|||||||
import {type MetricEvents} from '#/logger/metrics'
|
import {type MetricEvents} from '#/logger/metrics'
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
import * as persisted from '#/state/persisted'
|
import * as persisted from '#/state/persisted'
|
||||||
|
import packageDotJson from '../../../package.json'
|
||||||
import {useSession} from '../../state/session'
|
import {useSession} from '../../state/session'
|
||||||
import {timeout} from '../async/timeout'
|
import {timeout} from '../async/timeout'
|
||||||
import {useNonReactiveCallback} from '../hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '../hooks/useNonReactiveCallback'
|
||||||
@@ -25,6 +26,7 @@ type StatsigUser = {
|
|||||||
// This is the place where we can add our own stuff.
|
// This is the place where we can add our own stuff.
|
||||||
// Fields here have to be non-optional to be visible in the UI.
|
// Fields here have to be non-optional to be visible in the UI.
|
||||||
platform: 'ios' | 'android' | 'web'
|
platform: 'ios' | 'android' | 'web'
|
||||||
|
appVersion: string
|
||||||
bundleIdentifier: string
|
bundleIdentifier: string
|
||||||
bundleDate: number
|
bundleDate: number
|
||||||
refSrc: string
|
refSrc: string
|
||||||
@@ -210,6 +212,7 @@ function toStatsigUser(did: string | undefined): StatsigUser {
|
|||||||
refSrc,
|
refSrc,
|
||||||
refUrl,
|
refUrl,
|
||||||
platform: Platform.OS as 'ios' | 'android' | 'web',
|
platform: Platform.OS as 'ios' | 'android' | 'web',
|
||||||
|
appVersion: packageDotJson.version,
|
||||||
bundleIdentifier: BUNDLE_IDENTIFIER,
|
bundleIdentifier: BUNDLE_IDENTIFIER,
|
||||||
bundleDate: BUNDLE_DATE,
|
bundleDate: BUNDLE_DATE,
|
||||||
appLanguage: languagePrefs.appLanguage,
|
appLanguage: languagePrefs.appLanguage,
|
||||||
|
|||||||
Reference in New Issue
Block a user