private void InitIoC()
        {
            if (AppSettings.Container == null)
            {
                HttpClient = new ExtendedHttpClient();

                var builder           = new ContainerBuilder();
                var saverService      = new SaverService();
                var dataProvider      = new UserManager(saverService);
                var appInfo           = new AppInfo();
                var assetsHelper      = new AssetHelper();
                var connectionService = new ConnectionService();

                var localizationManager = new LocalizationManager(saverService, assetsHelper);
                var configManager       = new ConfigManager(saverService, assetsHelper);

                builder.RegisterInstance(assetsHelper).As <IAssetHelper>().SingleInstance();
                builder.RegisterInstance(appInfo).As <IAppInfo>().SingleInstance();
                builder.RegisterInstance(saverService).As <ISaverService>().SingleInstance();
                builder.RegisterInstance(dataProvider).As <UserManager>().SingleInstance();
                builder.RegisterInstance(connectionService).As <IConnectionService>().SingleInstance();
                builder.RegisterInstance(localizationManager).As <LocalizationManager>().SingleInstance();
                builder.RegisterInstance(configManager).As <ConfigManager>().SingleInstance();
                var configInfo      = assetsHelper.GetConfigInfo();
                var reporterService = new LogService(HttpClient, appInfo, configInfo.RavenClientDsn);
                builder.RegisterInstance(reporterService).As <ILogService>().SingleInstance();
                AppSettings.Container = builder.Build();

                MainChain   = AppSettings.User.Chain;
                SteemClient = new SteepshotApiClient(HttpClient, KnownChains.Steem);
                GolosClient = new SteepshotApiClient(HttpClient, KnownChains.Golos);
            }
        }
Exemple #2
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            var builder           = new ContainerBuilder();
            var saverService      = new SaverService();
            var dataProvider      = new UserManager(saverService);
            var appInfo           = new AppInfo();
            var connectionService = new ConnectionService();
            var assetsHelper      = new AssetsHelper();

            var localizationManager = new LocalizationManager(saverService, assetsHelper);
            var configManager       = new ConfigManager(saverService, assetsHelper);

            var ravenClientDSN  = assetsHelper.GetConfigInfo().RavenClientDsn;
            var reporterService = new Core.Sentry.ReporterService(appInfo, ravenClientDSN);

            builder.RegisterInstance(configManager).As <ConfigManager>().SingleInstance();
            builder.RegisterInstance(localizationManager).As <LocalizationManager>().SingleInstance();
            builder.RegisterInstance(assetsHelper).As <IAssetsHelper>().SingleInstance();
            builder.RegisterInstance(appInfo).As <IAppInfo>().SingleInstance();
            builder.RegisterInstance(saverService).As <ISaverService>().SingleInstance();
            builder.RegisterInstance(dataProvider).As <UserManager>().SingleInstance();
            builder.RegisterInstance(reporterService).As <IReporterService>().SingleInstance();
            builder.RegisterInstance(connectionService).As <IConnectionService>().SingleInstance();

            AppSettings.Container = builder.Build();

            GAService.Instance.InitializeGAService();

            AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) =>
            {
                AppSettings.Reporter.SendCrash((Exception)e.ExceptionObject);
            };
            TaskScheduler.UnobservedTaskException += (object sender, UnobservedTaskExceptionEventArgs e) =>
            {
                AppSettings.Reporter.SendCrash(e.Exception);
            };

            if (AppSettings.AppInfo.GetModel() != "Simulator")
            {
                OneSignal.Current.StartInit("77fa644f-3280-4e87-9f14-1f0c7ddf8ca5")
                .InFocusDisplaying(Com.OneSignal.Abstractions.OSInFocusDisplayOption.Notification)
                .HandleNotificationOpened(HandleNotificationOpened)
                .EndInit();
            }

            Window = new CustomWindow();
            if (AppSettings.User.IsAuthenticated)
            {
                InitialViewController = new MainTabBarController();
            }
            else
            {
                InitialViewController = new PreSearchViewController();
            }

            Window.RootViewController = new InteractivePopNavigationController(InitialViewController);
            Window.MakeKeyAndVisible();
            return(true);
        }
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            var builder           = new ContainerBuilder();
            var saverService      = new SaverService();
            var dataProvider      = new DataProvider(saverService);
            var appInfo           = new AppInfo();
            var connectionService = new ConnectionService();
            var assetsHelper      = new AssetsHelper();

            var localization        = dataProvider.SelectLocalization("en-us") ?? assetsHelper.GetLocalization("en-us");
            var localizationManager = new LocalizationManager(localization);

            var ravenClientDSN  = assetsHelper.GetConfigInfo().RavenClientDsn;
            var reporterService = new ReporterService(appInfo, ravenClientDSN);

            builder.RegisterInstance(localizationManager).As <LocalizationManager>().SingleInstance();
            builder.RegisterInstance(assetsHelper).As <IAssetsHelper>().SingleInstance();
            builder.RegisterInstance(appInfo).As <IAppInfo>().SingleInstance();
            builder.RegisterInstance(saverService).As <ISaverService>().SingleInstance();
            builder.RegisterInstance(dataProvider).As <IDataProvider>().SingleInstance();
            builder.RegisterInstance(reporterService).As <IReporterService>().SingleInstance();
            builder.RegisterInstance(connectionService).As <IConnectionService>().SingleInstance();

            AppSettings.Container = builder.Build();

            AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) =>
            {
                //AppSettings.Reporter.SendCrash((Error)e.ExceptionObject);
            };
            TaskScheduler.UnobservedTaskException += (object sender, UnobservedTaskExceptionEventArgs e) =>
            {
                //AppSettings.Reporter.SendCrash(e.Error);
            };

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

            if (BasePresenter.User.IsAuthenticated)
            {
                initialViewController = new MainTabBarController();
            }
            else
            {
                initialViewController = new PreSearchViewController();
            }

            if (BasePresenter.User.IsAuthenticated && !BasePresenter.User.IsNeedRewards)
            {
                BasePresenter.User.IsNeedRewards = true; // for ios users set true by default
            }
            Window.RootViewController = new InteractivePopNavigationController(initialViewController);
            Window.MakeKeyAndVisible();
            return(true);
        }
Exemple #4
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            var builder           = new ContainerBuilder();
            var saverService      = new SaverService();
            var dataProvider      = new DataProvider(saverService);
            var appInfo           = new AppInfo();
            var connectionService = new ConnectionService();
            var ravenClientDSN    = DebugHelper.GetRavenClientDSN();
            var reporterService   = new ReporterService(appInfo, ravenClientDSN);

            builder.RegisterInstance(appInfo).As <IAppInfo>().SingleInstance();
            builder.RegisterInstance(saverService).As <ISaverService>().SingleInstance();
            builder.RegisterInstance(dataProvider).As <IDataProvider>().SingleInstance();
            builder.RegisterInstance(reporterService).As <IReporterService>().SingleInstance();
            builder.RegisterInstance(connectionService).As <IConnectionService>().SingleInstance();

            AppSettings.Container = builder.Build();

            AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) =>
            {
                //AppSettings.Reporter.SendCrash((Exception)e.ExceptionObject);
            };
            TaskScheduler.UnobservedTaskException += (object sender, UnobservedTaskExceptionEventArgs e) =>
            {
                //AppSettings.Reporter.SendCrash(e.Exception);
            };

            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            if (BasePresenter.User.IsAuthenticated)
            {
                InitialViewController = new MainTabBarController();
            }
            else
            {
                InitialViewController = new PreSearchViewController();
            }

            var navController = new UINavigationController(InitialViewController);

            Window.RootViewController = navController;
            Window.MakeKeyAndVisible();
            return(true);
        }