From 8e24e0ed4ff439ff6c746325a1411f1208e64b8d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 26 十一月 2021 09:33:02 +0800
Subject: [PATCH] 1

---
 HDL-ON_iOS/AppDelegate.cs |   74 +++++++++++++++++++++++-------------
 1 files changed, 47 insertions(+), 27 deletions(-)

diff --git a/HDL-ON_iOS/AppDelegate.cs b/HDL-ON_iOS/AppDelegate.cs
index e7b6565..4568b86 100644
--- a/HDL-ON_iOS/AppDelegate.cs
+++ b/HDL-ON_iOS/AppDelegate.cs
@@ -10,6 +10,7 @@
 using HDL_ON.UI;
 using HDL_ON.DAL.Server;
 using Intents;
+using Other.Siri;
 
 namespace SharedMethod
 {
@@ -60,7 +61,7 @@
         //    // If not required for your application you can safely delete this method
         //    return true;
         //}
-        internal static UINavigationController rootViewController;
+        public static UINavigationController rootViewController;
 
         public static void CleanApplicationIconBadgeNumber()
         {
@@ -277,32 +278,8 @@
             //    //RemoteInfo.Current.ReadMsgList(true);
             //}
 
-            #region Siri
-            // 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;
-                }
-            });
-
-            var language = INPreferences.SiriLanguageCode;
-
-            // Take action based on language
-            if (language == "en-US")
-            {
-                // Do something...
-            }
-
-            #endregion
+            //楂樺痉key
+            GDMapKit.setGDApiKey("f0635ea15c5d579c6e93d9f07a06da69");
 
             Console.WriteLine("FinishedLaunching");
             return true;
@@ -473,6 +450,49 @@
             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);
+        }
+
     }
 
 }

--
Gitblit v1.8.0