Пример #1
0
        public Task TestTrackEventWithDimension()
        {
            Mock <IParseAnalyticsController>   mockController            = new Mock <IParseAnalyticsController>();
            Mock <IParseCorePlugins>           mockCorePlugins           = new Mock <IParseCorePlugins>();
            Mock <IParseCurrentUserController> mockCurrentUserController = new Mock <IParseCurrentUserController>();

            mockCorePlugins.Setup(corePlugins => corePlugins.CurrentUserController).Returns(mockCurrentUserController.Object);

            mockCurrentUserController.Setup(controller => controller.GetCurrentSessionTokenAsync(It.IsAny <CancellationToken>())).Returns(Task.FromResult("sessionToken"));

            ParseAnalyticsPlugins.Instance = new ParseAnalyticsPlugins
            {
                Controller  = mockController.Object,
                CorePlugins = mockCorePlugins.Object
            };

            return(ParseAnalytics.TrackEventAsync("SomeEvent", new Dictionary <string, string> {
                ["facebook"] = "hq"
            }).ContinueWith(t =>
            {
                Assert.IsFalse(t.IsFaulted);
                Assert.IsFalse(t.IsCanceled);
                mockController.Verify(obj => obj.TrackEventAsync(It.Is <string>(eventName => eventName == "SomeEvent"), It.Is <IDictionary <string, string> >(dict => dict != null && dict.Count == 1), It.IsAny <string>(), It.IsAny <CancellationToken>()), Times.Exactly(1));
            }));
        }
Пример #2
0
        public static void Initialize()
        {
            ParseObject.RegisterSubclass <ApParseUser>();
            ParseObject.RegisterSubclass <ApParseInstallation>();
            ParseObject.RegisterSubclass <ApParseSession>();

            ParseObject.RegisterSubclass <ApParseSighting>();
            ParseObject.RegisterSubclass <ApParseSite>();
            ParseObject.RegisterSubclass <ApParseRule>();
            ParseObject.RegisterSubclass <ApParseTaxon>();

            var config = new ParseClient.Configuration
            {
                ApplicationId = ConfigurationManager.AppSettings.ParseApplicationId,
                WindowsKey    = ConfigurationManager.AppSettings.ParseDotNetKey,
                Server        = ConfigurationManager.AppSettings.ParseServerUrl,
            };

            ParseClient.Initialize(config);
            ParseAnalytics.TrackAppOpenedAsync();

#if __ANDROID__
            ParsePush.ParsePushNotificationReceived += ParsePush.DefaultParsePushNotificationReceivedHandler;
            if (ParseUser.CurrentUser != null)
            {
                ParseInstallation.CurrentInstallation["user"] = ParseUser.CurrentUser;
                ParseInstallation.CurrentInstallation.SaveAsync();
            }
#endif
        }
Пример #3
0
        public Task TestTrackAppOpened()
        {
            var mockController            = new Mock <IParseAnalyticsController>();
            var mockCorePlugins           = new Mock <IParseCorePlugins>();
            var mockCurrentUserController = new Mock <IParseCurrentUserController>();

            mockCorePlugins
            .Setup(corePlugins => corePlugins.CurrentUserController)
            .Returns(mockCurrentUserController.Object);

            mockCurrentUserController
            .Setup(controller => controller.GetCurrentSessionTokenAsync(It.IsAny <CancellationToken>()))
            .Returns(Task.FromResult("sessionToken"));

            ParseAnalyticsPlugins plugins = new ParseAnalyticsPlugins();

            plugins.AnalyticsController    = mockController.Object;
            plugins.CorePlugins            = mockCorePlugins.Object;
            ParseAnalyticsPlugins.Instance = plugins;

            return(ParseAnalytics.TrackAppOpenedAsync().ContinueWith(t => {
                Assert.IsFalse(t.IsFaulted);
                Assert.IsFalse(t.IsCanceled);
                mockController.Verify(obj => obj.TrackAppOpenedAsync(It.Is <string>(pushHash => pushHash == null),
                                                                     It.IsAny <string>(),
                                                                     It.IsAny <CancellationToken>()), Times.Exactly(1));
            }));
        }
Пример #4
0
        public async Task RegisterForPush(IActivatedEventArgs args)
        {
            await ParsePush.SubscribeAsync("");

            await ParseInstallation.CurrentInstallation.SaveAsync();

            await ParseAnalytics.TrackAppOpenedAsync(args as LaunchActivatedEventArgs);
        }
Пример #5
0
    void OnDestroy()
    {
        var dimensions = new Dictionary <string, string>
        {
            { "scene", Application.loadedLevelName },
            { "time", GetTimeBucket() }
        };

        ParseAnalytics.TrackEventAsync("Scenes Visited", dimensions);
    }
 void Awake()
 {
     ParseObject.RegisterSubclass <Brain>();
     ParseUser.RegisterSubclass <Player>();
     ParseObject.RegisterSubclass <Match>();
     ParseObject.RegisterSubclass <Frame>();
     ParseObject.RegisterSubclass <BattleEvent>();
     ParseObject.RegisterSubclass <BrainEvent>();
     ParseAnalytics.TrackAppOpenedAsync();
 }
Пример #7
0
        protected async override void OnLaunched(LaunchActivatedEventArgs args)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            SettingsPane.GetForCurrentView().CommandsRequested += App_CommandsRequested;

            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                //lokal settings
                SuspensionManager.RegisterFrame(rootFrame, "mainAppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    await SuspensionManager.RestoreAsync();
                }

                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                INavigationService navigationService = new NavigationService();

                if (this.AuthenticatedUser == null)
                {
                    this.AuthenticatedUser = Parse.ParseUser.CurrentUser;
                }

                if (Parse.ParseUser.CurrentUser != null && Parse.ParseUser.CurrentUser.IsAuthenticated == true)
                {
                    navigationService.Navigate(ViewsType.Groups);
                }
                else if (!rootFrame.Navigate(typeof(LoginPage), args.Arguments))
                {
                    throw new Exception("Failed to create initial page");
                }
            }

            Window.Current.Activate();

            // Track this application being launched
            try
            {
                await ParseAnalytics.TrackAppOpenedAsync(args);
            }
            catch (Exception)
            {
            }
        }
Пример #8
0
        public void SendEvent(string name, IDictionary <string, object> data, AnalyticsServices services)
        {
            if (services == AnalyticsServices.ParseDotCom || services == AnalyticsServices.Both)
            {
                var specificData = data.ToDictionary(o => o.Key, o => o.Value.ToString());

                ParseAnalytics.TrackEventAsync(name, specificData);
            }
            if (services == AnalyticsServices.UnityAnalytics || services == AnalyticsServices.Both)
            {
                UnityAnalytics.CustomEvent(name, data);
            }
        }
 public async void LogViewHidden(string name)
 {
     if (Enabled)
     {
         await ParseAnalytics.TrackEventAsync(
             Constants.Tracking.ViewHidden.Replace(" ", "_"),
             new Dictionary <string, string>(){
             { Constants.Tracking.ViewName, name }
         }
             )
         .ConfigureAwait(false);
     }
 }
Пример #10
0
        public static void Main(string[] args)
        {
            //Initialize parse

            var appId  = ConfigurationManager.AppSettings["ParseApplicationId"];
            var winKey = ConfigurationManager.AppSettings["ParseWindowsKey"];

            ParseClient.Initialize(appId, winKey);
            ParseAnalytics.TrackAppOpenedAsync();

            var builder = new ContainerBuilder();

            builder.RegisterType <ConsoleWriter>().As <IOutputWriter>().SingleInstance();
            builder.RegisterType <HttpHelper>().As <IHttpHelper>().SingleInstance();
            builder.RegisterType <UrlStrategyFactory>().As <IUrlStrategyFactory>().SingleInstance();

            builder.RegisterType <ZoltanListener>().As <IListener>();
            builder.RegisterType <TorrentListener>().As <IListener>().PreserveExistingDefaults();
            builder.RegisterType <QuoteListener>().As <IListener>().PreserveExistingDefaults();
            builder.RegisterType <GameOnListener>().As <IListener>().PreserveExistingDefaults();
            builder.RegisterType <SportListener>().As <IListener>().PreserveExistingDefaults();
            builder.RegisterType <NordiskFilmListener>().As <IListener>().PreserveExistingDefaults();
            builder.RegisterType <WebListener>().As <IListener>().PreserveExistingDefaults();
            builder.RegisterType <RandomListener>().As <IListener>().PreserveExistingDefaults();
            builder.RegisterType <LaEmpanadaListener>().As <IListener>().PreserveExistingDefaults();
            builder.RegisterType <StringListener>().As <IListener>().PreserveExistingDefaults();
            builder.RegisterType <MffListener>().As <IListener>().PreserveExistingDefaults();
            builder.RegisterType <KolliListener>().As <IListener>().PreserveExistingDefaults();

            var container = builder.Build();

            var skypeHelper = new SkypeHelper(
                container.Resolve <IOutputWriter>(),
                container.Resolve <IEnumerable <IListener> >());

            skypeHelper.Initialize();

            try
            {
                var input = string.Empty;
                while (!input.ToUpper().Equals("QUIT"))
                {
                    input = Console.ReadLine() ?? string.Empty;
                }
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e);
            }
        }
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
            this.InitializeComponent();

            ParseClient.Initialize("HRd8Mraru64H28mmcfwiO3A2gyK7wYeu5UQDMFN0", "OSF70riVhcE5RztikTGsri72w5uQgJmAWqGMCpz0");
            // After calling ParseClient.Initialize():
            this.Startup += async(sender, args) =>
            {
                // This optional line tracks statistics around app opens, including push effectiveness:
                ParseAnalytics.TrackAppOpens(RootFrame);

                // By convention, the empty string is considered a "Broadcast" channel
                // Note that we had to add "async" to the definition to use the await keyword
                await ParsePush.SubscribeAsync("");
            };
            ParsePush.ToastNotificationReceived += ParsePushOnToastNotificationReceived;
            //NavigationService.Navigate(new Uri("/BingMaps.xaml", UriKind.Relative));
        }
 public async void LogError(string name, string title, string message)
 {
     if (Enabled)
     {
         await ParseAnalytics.TrackEventAsync(
             Constants.Tracking.UserError.Replace(" ", "_"),
             new Dictionary <string, string>(){
             { Constants.Tracking.UserErrorView, name },
             { Constants.Tracking.UserErrorTitle, title },
             { Constants.Tracking.UserErrorMessage, message }
         }
             )
         .ConfigureAwait(false);
     }
 }
 public async void LogEvent(string name, string category, string eventName, string eventData)
 {
     if (Enabled)
     {
         await ParseAnalytics.TrackEventAsync(
             name.Replace(" ", "_"),
             new Dictionary <string, string>(){
             { Constants.Tracking.Category, category },
             { Constants.Tracking.EventName, eventName },
             { Constants.Tracking.EventData, eventData },
         }
             )
         .ConfigureAwait(false);
     }
 }
Пример #14
0
        private async void frmMain_Loaded(object sender, RoutedEventArgs e)
        {
            ParseAnalytics.TrackAppOpenedAsync();

            m_RecentList = new List <ParseObject>();
            m_RegList    = new List <ParseObject>();

            //var testObject = new ParseObject("Windows");
            //testObject["WPF"] = "okay";
            //await testObject.SaveAsync();
            btn_regist.IsEnabled = false;
            btn_update.IsEnabled = false;


            await RefreshList();
        }
Пример #15
0
        public Task TestTrackAppOpened()
        {
            var mockController            = new Mock <IParseAnalyticsController>();
            var mockCurrentUserController = new Mock <IParseCurrentUserController>();

            ParseCorePlugins.Instance.AnalyticsController   = mockController.Object;
            ParseCorePlugins.Instance.CurrentUserController = mockCurrentUserController.Object;

            return(ParseAnalytics.TrackAppOpenedAsync().ContinueWith(t => {
                Assert.IsFalse(t.IsFaulted);
                Assert.IsFalse(t.IsCanceled);
                mockController.Verify(obj => obj.TrackAppOpenedAsync(It.Is <string>(pushHash => pushHash == null),
                                                                     It.IsAny <string>(),
                                                                     It.IsAny <CancellationToken>()), Times.Exactly(1));
            }));
        }
Пример #16
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            ParseClient.Initialize("4AbWipQ8dD4jpMF0yUYqANh33EuWtfeI44Jf4WIz", "arxKXH5YQ1b0SQVOP953N2G46THVdfwpb7rgxf8c");

            this.Startup += async(sender, args) =>
            {
                // This optional line tracks statistics around app opens, including push effectiveness:
                ParseAnalytics.TrackAppOpens(RootFrame);

                // By convention, the empty string is considered a "Broadcast" channel
                // Note that we had to add "async" to the definition to use the await keyword
                await ParsePush.SubscribeAsync("myTesthannel");
            };

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }
Пример #17
0
        public Task TestTrackEvent()
        {
            var mockController            = new Mock <IParseAnalyticsController>();
            var mockCurrentUserController = new Mock <IParseCurrentUserController>();

            ParseCorePlugins.Instance.AnalyticsController   = mockController.Object;
            ParseCorePlugins.Instance.CurrentUserController = mockCurrentUserController.Object;

            return(ParseAnalytics.TrackEventAsync("SomeEvent").ContinueWith(t => {
                Assert.IsFalse(t.IsFaulted);
                Assert.IsFalse(t.IsCanceled);
                mockController.Verify(obj => obj.TrackEventAsync(It.Is <string>(eventName => eventName == "SomeEvent"),
                                                                 It.Is <IDictionary <string, string> >(dict => dict == null),
                                                                 It.IsAny <string>(),
                                                                 It.IsAny <CancellationToken>()), Times.Exactly(1));
            }));
        }
        public async void LogPerformance(string category, TimeSpan performanceCounter, Dictionary <string, string> values = null)
        {
            if (values == null)
            {
                values = new Dictionary <string, string> ();
            }

            values ["Duration"] = ((long)performanceCounter.TotalMilliseconds).ToString();

            if (Enabled)
            {
                await ParseAnalytics.TrackEventAsync(
                    String.Format("Performance - {0}", category).Replace(" ", "_"),
                    values
                    )
                .ConfigureAwait(false);
            }
        }
Пример #19
0
    void LevelUp()
    {
        if (Player.Level <= mission)
        {
            Player.Level = mission + 1;
            Player.SaveAsync();
            var dimensions = new Dictionary <string, string>
            {
                { "level", "Level " + Player.Level }
            };

            ParseAnalytics.TrackEventAsync("Level Up", dimensions);
        }
        if (mission < 5)
        {
            PlayerPrefs.SetInt(MissionPanel.CURRENT_MISSION, mission + 1);
        }
    }
Пример #20
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Initialize the Parse client with your Application ID and Windows Key found on
            // your Parse dashboard
            ParseClient.Initialize("YOUR APPLICATION ID", "YOUR .NET KEY");

            this.Startup += (sender, args) => {
                ParseAnalytics.TrackAppOpens(RootFrame);
            };


            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }
Пример #21
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            ViewModel = new MainViewModel();

            ParseClient.Initialize("NhHOvcjOPfG9X4LKbaAID5FDeK4azh4ztb9LFdtt", "yubl7PgLAdxXs60WWHDi7iSURCzLRR0xJGTAn9MS");
            this.Startup += (sender, args) =>
            {
                ParseAnalytics.TrackAppOpens(RootFrame);
            };
        }
        /// <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="args">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs args)
        {
            Frame 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
                rootFrame = new Frame();

                if (args.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)
            {
                // 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), args.Arguments))
                {
                    throw new Exception("Failed to create initial page");
                }
            }
            // Ensure the current window is active
            Window.Current.Activate();

            // Track this application being launched
            await ParseAnalytics.TrackAppOpenedAsync(args);
        }
Пример #23
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 async void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame 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
                rootFrame = new Frame();

                // TODO: change this value to a cache size that is appropriate for your application
                rootFrame.CacheSize = 1;

                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)
                {
                    this.transitions = new TransitionCollection();
                    foreach (var c in rootFrame.ContentTransitions)
                    {
                        this.transitions.Add(c);
                    }
                }

                rootFrame.ContentTransitions = null;
                rootFrame.Navigated         += this.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();

            await ParsePush.SubscribeAsync("");

            ParseAnalytics.TrackAppOpenedAsync(e);
        }
Пример #24
0
 public static void ParseGallery()
 {
     ParseAnalytics.TrackEventAsync("Gallery Views");
     Debug.Log("tracking gallery view");
 }
Пример #25
0
 public static void ParseWellBeing()
 {
     ParseAnalytics.TrackEventAsync("Well Being Views");
     Debug.Log("tracking well being views");
 }
Пример #26
0
 public static void ParsePersonal()
 {
     ParseAnalytics.TrackEventAsync("Personal Views");
     Debug.Log("tracking personal view");
 }
Пример #27
0
 // Code to execute when the application is launching (eg, from Start)
 // This code will not execute when the application is reactivated
 private async void Application_Launching(object sender, LaunchingEventArgs e)
 {
     await ParseAnalytics.TrackAppOpenedAsync();
 }
Пример #28
0
 public override void Load()
 {
     UnityAnalytics.StartSDK(GameCore.Instance.UnityAnalyticsProjectId);
     ParseAnalytics.TrackAppOpenedAsync();
 }
Пример #29
0
 private async void Application_Startup(object sender, StartupEventArgs args)
 {
     await ParseAnalytics.TrackAppOpenedAsync();
 }