Skip to content

Commit

Permalink
[Statsig] Send locale info (#3621)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Apr 19, 2024
1 parent 55aea34 commit c42a557
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/statsig/statsig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {Statsig, StatsigProvider} from 'statsig-react-native-expo'

import {logger} from '#/logger'
import {isWeb} from '#/platform/detection'
import * as persisted from '#/state/persisted'
import {IS_TESTFLIGHT} from 'lib/app-info'
import {useSession} from '../../state/session'
import {timeout} from '../async/timeout'
Expand All @@ -23,6 +24,8 @@ type StatsigUser = {
platform: 'ios' | 'android' | 'web'
refSrc: string
refUrl: string
appLanguage: string
contentLanguages: string[]
}
}

Expand Down Expand Up @@ -132,13 +135,16 @@ function toStatsigUser(did: string | undefined): StatsigUser {
if (did) {
userID = sha256(did)
}
const languagePrefs = persisted.get('languagePrefs')
return {
userID,
platform: Platform.OS as 'ios' | 'android' | 'web',
custom: {
refSrc,
refUrl,
platform: Platform.OS as 'ios' | 'android' | 'web',
appLanguage: languagePrefs.appLanguage,
contentLanguages: languagePrefs.contentLanguages,
},
}
}
Expand Down

0 comments on commit c42a557

Please sign in to comment.