mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-04 06:51:45 -04:00
Integrate Sentry for Android app version and build tracking
This commit is contained in:
@@ -11,7 +11,7 @@ android {
|
||||
applicationId "com.compassconnections.app"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 81
|
||||
versionCode 82
|
||||
versionName "1.17.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
|
||||
@@ -5,6 +5,7 @@ import {App} from '@capacitor/app'
|
||||
import {Capacitor} from '@capacitor/core'
|
||||
import {Keyboard} from '@capacitor/keyboard'
|
||||
import {StatusBar} from '@capacitor/status-bar'
|
||||
import * as Sentry from '@sentry/node'
|
||||
import clsx from 'clsx'
|
||||
import {DEPLOYED_WEB_URL} from 'common/envs/constants'
|
||||
import {IS_VERCEL, PNG_FAVICON} from 'common/hosting/constants'
|
||||
@@ -167,6 +168,19 @@ function MyApp(props: AppProps<PageProps>) {
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
const fetchAppInfo = async () => {
|
||||
if (!Capacitor.isNativePlatform()) return
|
||||
const appInfo = await App.getInfo().catch((e) => debug('Could not load Android app info:', e))
|
||||
const appVersion = appInfo?.version
|
||||
if (appVersion) {
|
||||
Sentry.setTag('android_version', appVersion)
|
||||
Sentry.setTag('android_build_number', appInfo?.build)
|
||||
}
|
||||
}
|
||||
fetchAppInfo()
|
||||
}, [])
|
||||
|
||||
const title = 'Compass'
|
||||
const description = 'The platform for intentional connections'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user