I am trying to turn off the data collection in Xamarin Forms App as shown below
IDynatrace dynatrace = DependencyService.Get<IDynatrace>();
The above statements throws an InvalidCastException.
I came across a support documentation which mentions that this method can only be used, when the agent is started with the user optin feature by method
ConfigurationBuilder.withUserOptIn(boolean) or property
ConfigurationBuilder.PROP_USER_OPT_IN. I am unable to optin using the ConfigurationBuilder since it is not available. Looks like ConfigurationBuilder is not available in the Dynatrace.OneAgent.Xamarin package.
Any support to solve the issue is highly appreciated. TIA
Solved! Go to Solution.