Bitdrift integration (#7728)
* update bitdrift to 0.6.7 and enable iOS network integration (#7575) * update bitdrift to 0.6.5 and enable iOS network integration * Update src/lib/bitdrift.ts Co-authored-by: Mark <40143016+Maker-Mark@users.noreply.github.com> * update to 0.6.7 --------- Co-authored-by: Mark <40143016+Maker-Mark@users.noreply.github.com> * deps: Bump bitdrift to 0.6.8, fixes iOS network instrumentation bug (#7725) Co-authored-by: Eric Bailey <git@esb.lol> * Add stable ID copy, add todo * Nits * Temp enable * Temp debug * Revert some debug * Revert unnecessary change * Use new gates * Add anon ID to version string --------- Co-authored-by: Snow Pettersen <snowp@lyft.com> Co-authored-by: Mark <40143016+Maker-Mark@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@atproto/api": "^0.13.35",
|
"@atproto/api": "^0.13.35",
|
||||||
"@bitdrift/react-native": "^0.6.2",
|
"@bitdrift/react-native": "^0.6.8",
|
||||||
"@braintree/sanitize-url": "^6.0.2",
|
"@braintree/sanitize-url": "^6.0.2",
|
||||||
"@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet",
|
"@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet",
|
||||||
"@emoji-mart/react": "^1.1.1",
|
"@emoji-mart/react": "^1.1.1",
|
||||||
|
|||||||
+9
-2
@@ -1,23 +1,30 @@
|
|||||||
import {init, SessionStrategy} from '@bitdrift/react-native'
|
import {init, SessionStrategy} from '@bitdrift/react-native'
|
||||||
import {Statsig} from 'statsig-react-native-expo'
|
import {Statsig} from 'statsig-react-native-expo'
|
||||||
export {debug, error, info, warn} from '@bitdrift/react-native'
|
|
||||||
|
|
||||||
import {initPromise} from './statsig/statsig'
|
import {initPromise} from './statsig/statsig'
|
||||||
|
|
||||||
|
export {debug, error, info, warn} from '@bitdrift/react-native'
|
||||||
|
|
||||||
const BITDRIFT_API_KEY = process.env.BITDRIFT_API_KEY
|
const BITDRIFT_API_KEY = process.env.BITDRIFT_API_KEY
|
||||||
|
|
||||||
initPromise.then(() => {
|
initPromise.then(() => {
|
||||||
let isEnabled = false
|
let isEnabled = false
|
||||||
|
let isNetworkEnabled = false
|
||||||
try {
|
try {
|
||||||
if (Statsig.checkGate('enable_bitdrift')) {
|
if (Statsig.checkGate('enable_bitdrift_v2')) {
|
||||||
isEnabled = true
|
isEnabled = true
|
||||||
}
|
}
|
||||||
|
if (Statsig.checkGate('enable_bitdrift_v2_networking')) {
|
||||||
|
isNetworkEnabled = true
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Statsig may complain about it being called too early.
|
// Statsig may complain about it being called too early.
|
||||||
}
|
}
|
||||||
if (isEnabled && BITDRIFT_API_KEY) {
|
if (isEnabled && BITDRIFT_API_KEY) {
|
||||||
init(BITDRIFT_API_KEY, SessionStrategy.Activity, {
|
init(BITDRIFT_API_KEY, SessionStrategy.Activity, {
|
||||||
url: 'https://api-bsky.bitdrift.io',
|
url: 'https://api-bsky.bitdrift.io',
|
||||||
|
// Only effects iOS, Android instrumentation is set via Gradle Plugin
|
||||||
|
enableNetworkInstrumentation: isNetworkEnabled,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
import {useMemo} from 'react'
|
||||||
import {Platform} from 'react-native'
|
import {Platform} from 'react-native'
|
||||||
import {setStringAsync} from 'expo-clipboard'
|
import {setStringAsync} from 'expo-clipboard'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
import {Statsig} from 'statsig-react-native-expo'
|
||||||
|
|
||||||
import {appVersion, BUNDLE_DATE, bundleInfo} from '#/lib/app-info'
|
import {appVersion, BUNDLE_DATE, bundleInfo} from '#/lib/app-info'
|
||||||
import {STATUS_PAGE_URL} from '#/lib/constants'
|
import {STATUS_PAGE_URL} from '#/lib/constants'
|
||||||
@@ -20,6 +22,7 @@ type Props = NativeStackScreenProps<CommonNavigatorParams, 'AboutSettings'>
|
|||||||
export function AboutSettingsScreen({}: Props) {
|
export function AboutSettingsScreen({}: Props) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const [devModeEnabled, setDevModeEnabled] = useDevModeEnabled()
|
const [devModeEnabled, setDevModeEnabled] = useDevModeEnabled()
|
||||||
|
const stableID = useMemo(() => Statsig.getStableID(), [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout.Screen>
|
<Layout.Screen>
|
||||||
@@ -79,7 +82,7 @@ export function AboutSettingsScreen({}: Props) {
|
|||||||
}}
|
}}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
setStringAsync(
|
setStringAsync(
|
||||||
`Build version: ${appVersion}; Bundle info: ${bundleInfo}; Bundle date: ${BUNDLE_DATE}; Platform: ${Platform.OS}; Platform version: ${Platform.Version}`,
|
`Build version: ${appVersion}; Bundle info: ${bundleInfo}; Bundle date: ${BUNDLE_DATE}; Platform: ${Platform.OS}; Platform version: ${Platform.Version}; Anonymous ID: ${stableID}`,
|
||||||
)
|
)
|
||||||
Toast.show(_(msg`Copied build version to clipboard`))
|
Toast.show(_(msg`Copied build version to clipboard`))
|
||||||
}}>
|
}}>
|
||||||
|
|||||||
@@ -3427,10 +3427,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||||
|
|
||||||
"@bitdrift/react-native@^0.6.2":
|
"@bitdrift/react-native@^0.6.8":
|
||||||
version "0.6.2"
|
version "0.6.8"
|
||||||
resolved "https://registry.yarnpkg.com/@bitdrift/react-native/-/react-native-0.6.2.tgz#8e75d45a63fccad38b310fdea8069fa929cb97c3"
|
resolved "https://registry.yarnpkg.com/@bitdrift/react-native/-/react-native-0.6.8.tgz#386495857bc81345de418750b5ca0e3c3b964f6c"
|
||||||
integrity sha512-4DIsZwAr9/Q1RI7lsnUphRoMuOuLWWESNXI759niSmU8XHTJISwwOQzUm7qWn7waBJGhxaq+jn+vlTV5Fai6zw==
|
integrity sha512-ixjJTEfUz3GeQ7srxpoYpnOGVx+iDA/A8Y3CZe5cg+/b0d8xur8fBKFoRBiXXohzJnYq4W8MIWIhLAwm5sD9oA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@expo/config-plugins" "^9.0.14"
|
"@expo/config-plugins" "^9.0.14"
|
||||||
fast-json-stringify "^6.0.0"
|
fast-json-stringify "^6.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user