Ejemplo n.º 1
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            app.StatusBarHidden = true;

            UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(246, 246, 247);
            UINavigationBar.Appearance.TintColor    = UIColor.Black;
            UIBarButtonItem.Appearance.TintColor    = UIColor.Black;


            global::Xamarin.Forms.Forms.Init();

            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
            //SQLitePCL.CurrentPlatform.Init();
            //http://motzcod.es/post/150988588867/updating-azure-mobile-sqlitestore-to-30
            //SQLitePCL.Batteries.Init();

            var settings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert
                                                                          | UIUserNotificationType.Badge
                                                                          | UIUserNotificationType.Sound,
                                                                          new NSSet());

            UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
            UIApplication.SharedApplication.RegisterForRemoteNotifications();

            var formsApp = new ContosoInsurance.App();

            LoadApplication(formsApp);

            try
            {
                var manager = BITHockeyManager.SharedHockeyManager;
                manager.Configure(HOCKEYAPP_APPID);
                manager.DisableUpdateManager = true;
                manager.StartManager();
                //manager.Authenticator.AuthenticateInstallation(); // This line is obsolete in crash only builds
            }
            catch (Exception e)
            {
            }

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 2
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            app.StatusBarHidden = true;

            UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(246, 246, 247);
            UINavigationBar.Appearance.TintColor    = UIColor.Black;
            UIBarButtonItem.Appearance.TintColor    = UIColor.Black;


            global::Xamarin.Forms.Forms.Init();

            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
            SQLitePCL.CurrentPlatform.Init();

            if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                var settings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Sound |
                                                                              UIUserNotificationType.Alert |
                                                                              UIUserNotificationType.Badge, null);

                UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
                UIApplication.SharedApplication.RegisterForRemoteNotifications();
            }
            else
            {
                UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.Badge |
                                                                                   UIRemoteNotificationType.Sound |
                                                                                   UIRemoteNotificationType.Alert);
            }

            var formsApp = new ContosoInsurance.App();

            LoadApplication(formsApp);

            return(base.FinishedLaunching(app, options));
        }