예제 #1
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Forms.Init();
            ImageCircleRenderer.Init();

            var setup = new Setup(this, Window);

            setup.Initialize();

            // UserDialogs is initialized automatically

            var presenter = Mvx.Resolve <MasterDetailViewPresenter>();

            if (presenter == null)
            {
                return(false);
            }

            var mvxFormsApp = new InnovativeApp();

            presenter.FormsApplication = mvxFormsApp;

            LoadApplication(mvxFormsApp);

            Mvx.Resolve <IMvxAppStart>().Start();
            Mvx.RegisterSingleton(this);

            try
            {
                App.Configure();
                RegisterForRemoteNotifications();
            }
            catch (Exception e)
            {
                Logger.Error("App.Configure", e);
            }

            // create a new window instance based on the screen size
            //Window = new UIWindow(UIScreen.MainScreen.Bounds);

            // If you have defined a root view controller, set it here:
            // Window.RootViewController = myViewController;

            // make the window visible
            //Window.MakeKeyAndVisible();

            return(base.FinishedLaunching(application, launchOptions));
        }
예제 #2
0
        protected override void OnCreate(Bundle bundle)
        {
            // Must be called before base.OnCreate (bundle);
            ToolbarResource   = Resource.Layout.Toolbar;
            TabLayoutResource = Resource.Layout.TabLayout;

            base.OnCreate(bundle);

            Forms.Init(this, bundle);
            ImageCircleRenderer.Init();

            // Leverage controls' StyleId attrib. to Xamarin.UITest
            Forms.ViewInitialized += (sender, e) =>
            {
                var viewStyleId = e.View.StyleId;
                if (!string.IsNullOrWhiteSpace(viewStyleId))
                {
                    e.NativeView.ContentDescription = viewStyleId;
                }
            };

            UserDialogs.Init(() => (Activity)Forms.Context);

            var presenter = Mvx.Resolve <MasterDetailViewPresenter>();

            if (presenter == null)
            {
                return;
            }

            var mvxFormsApp = new InnovativeApp();

            presenter.FormsApplication = mvxFormsApp;

            LoadApplication(mvxFormsApp);

            Mvx.Resolve <IMvxAppStart>().Start();
            Mvx.RegisterSingleton(this);
            Mvx.RegisterSingleton <IMvxAndroidCurrentTopActivity>(this);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            FirebaseApp.InitializeApp(this);
            IsPlayServicesAvailable();
            try
            {
                FirebaseMessaging.Instance.SubscribeToTopic("All");
            }
            catch (Exception e)
            {
                Logger.Error("Error", e);
            }
            //FirebaseCrash.Report(new Exception("PROVA"));

            // Handle possible data accompanying notification message.
            // [START handle_data_extras]
            if (Intent.Extras != null)
            {
                foreach (var key in Intent.Extras.KeySet())
                {
                    var value = Intent.Extras.GetString(key);
                    Logger.Trace($"Key: {key} Value: {value}");
                }
            }
            // [END handle_data_extras]
        }