wxr
2021-11-29 dd7e4794fd611de967c6322dd0bb7ffda41c2f7b
HDL-ON_iOS/AppDelegate.cs
@@ -10,7 +10,6 @@
using HDL_ON.UI;
using HDL_ON.DAL.Server;
using Intents;
using Other.Siri;
namespace SharedMethod
{
@@ -450,48 +449,6 @@
            HDL_ON.DriverLayer.Control.Ins.SearchLoaclGateway();
        }
        public override bool ContinueUserActivity(UIApplication application, NSUserActivity userActivity, UIApplicationRestorationHandler completionHandler)
        {
            var intent = userActivity.GetInteraction()?.Intent as HDLSceneSiri.HDLRunSceneIntent;
            if (!(intent is null))
            {
                HandleIntent(intent);
                return true;
            }
            else if (userActivity.ActivityType == NSUserActivityHelper.ViewMenuActivityType)
            {
                HandleUserActivity();
                return true;
            }
            return false;
        }
        void HandleIntent(HDLSceneSiri.HDLRunSceneIntent intent)
        {
            var handler = new SiriKit.HDLRunSceneIntentHandlder();
            handler.HandleRunScene(intent, (response) => {
                if (response.Code != HDLSceneSiri.HDLRunSceneIntentResponseCode.Success)
                {
                    Console.WriteLine("Siri执行失败。");
                }
            });
        }
        void HandleUserActivity()
        {
            //var rootViewController = Window?.RootViewController as UINavigationController;
            //var orderHistoryViewController = rootViewController?.ViewControllers?.FirstOrDefault() as OrderHistoryTableViewController;
            //if (orderHistoryViewController is null)
            //{
            //    Console.WriteLine("Failed to access OrderHistoryTableViewController.");
            //    return;
            //}
            //var segue = OrderHistoryTableViewController.SegueIdentifiers.SoupMenu;
            //orderHistoryViewController.PerformSegue(segue, null);
        }
    }