How to get the DNS already initialized for Sentry

Hello

For Android we are developing a component, who will use Sentry to collect errors.

As this component will be used in projects who also has Sentry enabled, to avoid double Sentry initialization/corruption, we need to know whether Sentry has already be initialized or not, for example, by checking whether DSN is already set or not.

So we are expecting a method to return the DSN who has been set during the init call. If it is empty, then our component will make an internal call to init; if it is not empty, it means the project already has its own Sentry DSN, thus our component will not call init again to protect the settings against corruption.

Or is there any other method to detect whether Sentry has been initialized or not?

B.R.

Liang

Hi @liangrong which SDK version are you working with? if >= 2.0

Sentry. isEnabled()

Excellent!