Sentry-java: Set BuildConfig.VERSION_CODE to sentry.properties

Created on 10 Aug 2018  路  1Comment  路  Source: getsentry/sentry-java

Hi.
We have integrated Sentry in our Android app. We have used the sentry.properties with this data:

environment=dev dsn=https://xxx release=2.0.0

We would like to set the environment and release variables data from BuildConfig.BUILD_TYPE and BuildConfig.VERSION_NAME.

How can we do it?

Thanks in advance.

Most helpful comment

You'd have to do it at application launch (in code).

Something like Sentry.getStoredClient().setEnvironment(BuildConfig.BUILD_TYPE); etc: https://github.com/getsentry/sentry-java/blob/4b810150969108429bbb36d28227cb128b986aa0/sentry/src/main/java/io/sentry/SentryClient.java#L292-L294

>All comments

You'd have to do it at application launch (in code).

Something like Sentry.getStoredClient().setEnvironment(BuildConfig.BUILD_TYPE); etc: https://github.com/getsentry/sentry-java/blob/4b810150969108429bbb36d28227cb128b986aa0/sentry/src/main/java/io/sentry/SentryClient.java#L292-L294

Was this page helpful?
0 / 5 - 0 ratings