コード例 #1
0
 public MainForm()
 {
     InitializeComponent();
     YandexMetricaFolder.SetCurrent("");
     YandexMetrica.Activate("eafbf946-7082-4f83-aef3-6e99c1911a62");
     AppDomain.CurrentDomain.UnhandledException += Application_ThreadException;
 }
コード例 #2
0
        static Events()
        {
            var metrika = Configuration.Config.GetSection("metrika");

            YandexMetricaFolder.SetCurrent(metrika.GetValue <string>("folder"));
            YandexMetrica.Config.CrashTracking = true;
            YandexMetrica.Activate(metrika.GetValue <string>("token"));
        }
コード例 #3
0
        public static void AppStart()
        {
            //may cause problems with restoring
            YandexMetrica.Activate("2a556755-72e7-450d-9bab-c3eb179ec300");

#if DEBUG
            _logger.Info("App started");
#endif
        }
コード例 #4
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            var deferral = taskInstance.GetDeferral();

            YandexMetrica.Config.LocationTracking = false;
            //TODO: https://tech.yandex.com/metrica-mobile-sdk/doc/mobile-sdk-dg/tasks/winphone-quickstart-docpage/
            YandexMetrica.Activate("Yours Api Key");
            YandexMetrica.ReportEvent("Hello from background!");
            YandexMetrica.Snapshot();
            deferral.Complete();
        }
コード例 #5
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used when the application is launched to open a specific file, to display
        /// search results, and so forth.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            //TODO: https://tech.yandex.com/metrica-mobile-sdk/doc/mobile-sdk-dg/tasks/winphone-quickstart-docpage/
            YandexMetrica.Activate("Yours Api Key");

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            var rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                // TODO: change this value to a cache size that is appropriate for your application
                rootFrame = new Frame {
                    CacheSize = 1
                };

                // TODO: change this value to a cache size that is appropriate for your application

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
#if WINDOWS_PHONE_APP
                // Removes the turnstile navigation for startup.
                if (rootFrame.ContentTransitions != null)
                {
                    _transitions = new TransitionCollection();
                    foreach (var c in rootFrame.ContentTransitions)
                    {
                        _transitions.Add(c);
                    }
                }

                rootFrame.ContentTransitions = null;
                rootFrame.Navigated         += RootFrame_FirstNavigated;
#endif

                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
                {
                    throw new Exception("Failed to create initial page");
                }
            }

            // Ensure the current window is active
            Window.Current.Activate();
        }
コード例 #6
0
 public static void Activate()
 {
     YandexMetrica.Activate(key);
 }
コード例 #7
0
ファイル: Logger.cs プロジェクト: punker76/meridian-uwp
        public static void AppStart()
        {
            YandexMetrica.Activate("567e94f7-257a-4c7a-b0aa-d1c8dc73d8c9");

            _logger.Info("App started. v" + AppInfoHelper.GetAppVersionString());
        }
コード例 #8
0
 public App()
 {
     YandexMetrica.Activate(ApiKey);
 }
コード例 #9
0
 private async void ActivateMetrica()
 {
     await Task.Run(() => YandexMetrica.Activate(AppConstants.YANDEX_METRICA_API_KEY));
 }