Exemplo 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)
        {
            global::Xamarin.Forms.Forms.Init();
            global::ZXing.Net.Mobile.Forms.iOS.Platform.Init();


            client = new Auth0Client(new Auth0ClientOptions()
            {
                Domain   = "dev-4l7acohw.auth0.com",
                ClientId = "Srn3fq8ccb7dnBmskN5VNGG2A4A0XKz4"
            });

            ToPageControllerAction = ToPageController;
            UIApplication.SharedApplication.StatusBarHidden = true;
            UIApplication.SharedApplication.SetMinimumBackgroundFetchInterval(UIApplication.BackgroundFetchIntervalMinimum);
            if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
            {
                UNUserNotificationCenter.Current.RequestAuthorization(UNAuthorizationOptions.Badge | UNAuthorizationOptions.Alert | UNAuthorizationOptions.Sound, (a, e) => { Console.WriteLine("NOTIFICATION REGISTER COMPLETE: &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" + a); });
                UNUserNotificationCenter.Current.Delegate = new UserNotificationCenterDelegate();
            }
            else
            {
                var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null);
                UIApplication.SharedApplication.RegisterUserNotificationSettings(notificationSettings);
            }

            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            NSTimer.CreateRepeatingScheduledTimer(10, t => InvokeOnMainThread(() => Console.WriteLine("AppDelegate 78 ping has ID Group " + IDGenerator.HasIDGroup("untitled shelf 0"))));
            LoadApplication(new App());

            ((MainPage)Xamarin.Forms.Application.Current.MainPage).InitializeLogin(
                () => { ContentManager.isLocal = true; ToPageController(); },
                async() => { ContentManager.isLocal = false; await LoginAsync(); ToPageController(); });

            mainViewController = Window.RootViewController;

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