public override void ViewDidLoad()
        {
            // https://medium.com/@PavelGnatyuk/large-title-and-search-in-ios-11-514d5e020cee
            NavigationBar.PrefersLargeTitles = true;

            // Request access to Siri
            INPreferences.RequestSiriAuthorization((INSiriAuthorizationStatus status) => {
                // Respond to returned status
                switch (status)
                {
                case INSiriAuthorizationStatus.Authorized:
                    Console.WriteLine("SiriKit Authorized");
                    break;

                case INSiriAuthorizationStatus.Denied:
                    Console.WriteLine("SiriKit Denied");
                    break;

                case INSiriAuthorizationStatus.NotDetermined:
                    Console.WriteLine("SiriKit Not Determined");
                    break;

                case INSiriAuthorizationStatus.Restricted:
                    Console.WriteLine("SiriKit Restricted");
                    break;
                }

                // Save status
                AppDelegate.SiriAuthorizationStatus = status;
            });

            base.ViewDidLoad();
        }
Example #2
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Request access to Siri

            INPreferences.RequestSiriAuthorization((INSiriAuthorizationStatus status) =>
            {
                // Respond to returned status
                switch (status)
                {
                case INSiriAuthorizationStatus.Authorized:
                    break;

                case INSiriAuthorizationStatus.Denied:
                    break;

                case INSiriAuthorizationStatus.NotDetermined:
                    break;

                case INSiriAuthorizationStatus.Restricted:
                    break;
                }
            });

            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method

            return(true);
        }
Example #3
0
        // FinishedLaunching is the very first code to be executed in your app. Don't forget to call base!
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskSchedulerOnUnobservedTaskException;

            var result = base.FinishedLaunching(application, launchOptions);

            //CustomizeAppearance();
            DisplayCrashReport();

            INPreferences.RequestSiriAuthorization(
                status =>
            {
                switch (status)
                {
                case INSiriAuthorizationStatus.Authorized:
                    break;

                case INSiriAuthorizationStatus.Denied:
                    break;

                case INSiriAuthorizationStatus.NotDetermined:
                    break;

                case INSiriAuthorizationStatus.Restricted:
                    break;
                }
            });

            return(result);
        }
Example #4
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.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental");
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());

            // Request access to Siri
            INPreferences.RequestSiriAuthorization((INSiriAuthorizationStatus status) => {
                // Respond to returned status
                switch (status)
                {
                case INSiriAuthorizationStatus.Authorized:
                    break;

                case INSiriAuthorizationStatus.Denied:
                    break;

                case INSiriAuthorizationStatus.NotDetermined:
                    break;

                case INSiriAuthorizationStatus.Restricted:
                    break;
                }
            });

            return(base.FinishedLaunching(app, options));
        }
Example #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            // Request access to Siri
            INPreferences.RequestSiriAuthorization((INSiriAuthorizationStatus status) => {
                // Respond to returned status
                switch (status)
                {
                case INSiriAuthorizationStatus.Authorized:
                    Console.WriteLine("SiriKit Authorized");
                    break;

                case INSiriAuthorizationStatus.Denied:
                    Console.WriteLine("SiriKit Denied");
                    break;

                case INSiriAuthorizationStatus.NotDetermined:
                    Console.WriteLine("SiriKit Not Determined");
                    break;

                case INSiriAuthorizationStatus.Restricted:
                    Console.WriteLine("SiriKit Restricted");
                    break;
                }

                // Save status
                AppDelegate.SiriAuthorizationStatus = status;
            });
        }
Example #6
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method

            INPreferences.RequestSiriAuthorization(status => {
                if (status != INSiriAuthorizationStatus.Authorized)
                {
                    Console.WriteLine("You need to grant permission to siri");
                }

                Console.WriteLine($"Siri Auth: {status}");
            });

            return(true);
        }
Example #7
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Request access to Siri
            INPreferences.RequestSiriAuthorization((INSiriAuthorizationStatus status) => {
                // Respond to returned status
                switch (status)
                {
                case INSiriAuthorizationStatus.Authorized:
                    Console.WriteLine("SiriKit Authorized");
                    break;

                case INSiriAuthorizationStatus.Denied:
                    Console.WriteLine("SiriKit Denied");
                    break;

                case INSiriAuthorizationStatus.NotDetermined:
                    Console.WriteLine("SiriKit Not Determined");
                    break;

                case INSiriAuthorizationStatus.Restricted:
                    Console.WriteLine("SiriKit Restricted");
                    break;
                }

                // Request notification permissions from the user
                UNUserNotificationCenter.Current.RequestAuthorization(UNAuthorizationOptions.Alert, (approved, err) => {
                    // Handle approval
                });

                // Save status
                SiriAuthorizationStatus = status;
            });

            // Populate the address book
            AddressBook.LoadAddressBook();

            // Inform system of successful launch
            return(true);
        }