Esempio n. 1
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));
            }));
        }
Esempio n. 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
        }
Esempio n. 3
0
        public async Task RegisterForPush(IActivatedEventArgs args)
        {
            await ParsePush.SubscribeAsync("");

            await ParseInstallation.CurrentInstallation.SaveAsync();

            await ParseAnalytics.TrackAppOpenedAsync(args as LaunchActivatedEventArgs);
        }
 void Awake()
 {
     ParseObject.RegisterSubclass <Brain>();
     ParseUser.RegisterSubclass <Player>();
     ParseObject.RegisterSubclass <Match>();
     ParseObject.RegisterSubclass <Frame>();
     ParseObject.RegisterSubclass <BattleEvent>();
     ParseObject.RegisterSubclass <BrainEvent>();
     ParseAnalytics.TrackAppOpenedAsync();
 }
Esempio n. 5
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)
            {
            }
        }
Esempio n. 6
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);
            }
        }
Esempio n. 7
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();
        }
Esempio n. 8
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));
            }));
        }
        /// <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);
        }
Esempio n. 10
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();
 }
Esempio n. 11
0
 public override void Load()
 {
     UnityAnalytics.StartSDK(GameCore.Instance.UnityAnalyticsProjectId);
     ParseAnalytics.TrackAppOpenedAsync();
 }
Esempio n. 12
0
 private async void Application_Startup(object sender, StartupEventArgs args)
 {
     await ParseAnalytics.TrackAppOpenedAsync();
 }
Esempio n. 13
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);
        }