예제 #1
0
        /// <summary>
        /// Finished the launching.
        /// </summary>
        /// <param name="app">The app.</param>
        /// <param name="options">The options.</param>
        /// <returns>True or false.</returns>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // Stamp the date this was installed (first run)
            StampInstallDate("CodeBucket");

            this.Window = new UIWindow(UIScreen.MainScreen.Bounds);
            var presenter = new IosViewPresenter(this.Window);
            var setup     = new Setup(this, presenter);

            setup.Initialize();

            // Setup theme
            Theme.Setup();

            var startup = Mvx.Resolve <IMvxAppStart>();

            startup.Start();

            this.Window.MakeKeyAndVisible();

            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false);
            UIApplication.SharedApplication.SetStatusBarHidden(false, UIStatusBarAnimation.Fade);

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Finished the launching.
        /// </summary>
        /// <param name="app">The app.</param>
        /// <param name="options">The options.</param>
        /// <returns>True or false.</returns>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // Stamp the date this was installed (first run)
            StampInstallDate("CodeBucket");

            var exceptionSubject = new Subject <Exception>();

            RxApp.DefaultExceptionHandler = exceptionSubject;
            exceptionSubject.Subscribe(x => AlertDialogService.ShowAlert("Error", x.Message));

            Window    = new UIWindow(UIScreen.MainScreen.Bounds);
            Presenter = new IosViewPresenter(Window);
            new Setup(this, Presenter).Initialize();

            // Setup theme
            Theme.Setup();

            GoToStartupView();

            Window.MakeKeyAndVisible();
            return(true);
        }
예제 #3
0
        /// <summary>
        /// Finished the launching.
        /// </summary>
        /// <param name="app">The app.</param>
        /// <param name="options">The options.</param>
        /// <returns>True or false.</returns>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // Stamp the date this was installed (first run)
            var stampedDate = StampInstallDate("CodeBucket");

            //Register all services
            Services.ServiceRegistration.Register();

            var culture = new System.Globalization.CultureInfo("en");

            System.Threading.Thread.CurrentThread.CurrentCulture           = culture;
            System.Threading.Thread.CurrentThread.CurrentUICulture         = culture;
            System.Globalization.CultureInfo.DefaultThreadCurrentCulture   = culture;
            System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = culture;

            var exceptionSubject = new Subject <Exception>();

            RxApp.DefaultExceptionHandler = exceptionSubject;
            exceptionSubject.Subscribe(x => AlertDialogService.ShowAlert("Error", x.Message));

            var purchaseService = Locator.Current.GetService <IInAppPurchaseService>();

            purchaseService.ThrownExceptions.Subscribe(ex =>
            {
                AlertDialogService.ShowAlert("Error Purchasing", ex.Message);
            });

            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            Theme.Setup();

            var featuresService = Locator.Current.GetService <IFeaturesService>();

            if (stampedDate <= new DateTime(2016, 7, 30, 0, 0, 0))
            {
                featuresService.ActivateProDirect();
            }

#if DEBUG
            featuresService.ActivateProDirect();
#endif

            //var defaultValueService = Locator.Current.GetService<IDefaultValueService>();

            //bool hasSeenWelcome;
            //if (!defaultValueService.TryGet("HAS_SEEN_WELCOME_INTRO", out hasSeenWelcome) || !hasSeenWelcome)
            //{
            //defaultValueService.Set("HAS_SEEN_WELCOME_INTRO", true);
            //var welcomeViewController = new CodeBucket.ViewControllers.Walkthrough.WelcomePageViewController();
            //welcomeViewController.WantsToDimiss += GoToStartupView;
            //TransitionToViewController(welcomeViewController);
            //}
            //else
            //{
            GoToStartupView();
            //}


            Window.MakeKeyAndVisible();
            return(true);
        }