internal static void UnregisterNativeIntegration(this SentryXamarinFormsIntegration integration, SentryXamarinOptions options)
        {
#if NATIVE_PROCESSOR
            integration?.Nativeintegration?.Unregister();
#endif
            options.NativeIntegrationEnabled = false;
        }
示例#2
0
        /// <summary>
        /// Add the Sentry Xamarin Forms integration to Sentry.Xamarin SDK.
        /// </summary>
        /// <param name="options">The Sentry Xamarion Options.</param>
        public static void AddXamarinFormsIntegration(this SentryXamarinOptions options)
        {
            var applicationListener = new FormsApplicationListener(options);

            var formsIntegration = new SentryXamarinFormsIntegration(options);

            options.AddIntegration(formsIntegration);
            applicationListener.AddListener(formsIntegration.RegisterRequestThemeChange);

            if (options.PageTracker is null)
            {
                var navigationIntegration = new FormsNavigationIntegration();
                options.AddPageNavigationTrackerIntegration(navigationIntegration);
                applicationListener.AddListener(navigationIntegration.ApplySentryNavigationEvents);
            }

            options.ProtocolPackageName = ProtocolPackageName;

            applicationListener.Invoke();
        }