| | |
| | | using HDL_ON.DAL.Server; |
| | | using Intents; |
| | | using Other.Siri; |
| | | using HDLSceneSiri; |
| | | |
| | | namespace SharedMethod |
| | | { |
| | |
| | | // //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; |
| | |
| | | |
| | | |
| | | |
| | | #region Siri |
| | | |
| | | public override bool ContinueUserActivity(UIApplication application, NSUserActivity userActivity, UIApplicationRestorationHandler completionHandler) |
| | | { |
| | | var intent = userActivity.GetInteraction()?.Intent as HDLRunSceneIntent; |
| | | var intent = userActivity.GetInteraction()?.Intent as HDLSceneSiri.HDLRunSceneIntent; |
| | | if (!(intent is null)) |
| | | { |
| | | HandleIntent(intent); |
| | |
| | | return false; |
| | | } |
| | | |
| | | void HandleIntent(HDLRunSceneIntent intent) |
| | | void HandleIntent(HDLSceneSiri.HDLRunSceneIntent intent) |
| | | { |
| | | var handler = new HDLRunSceneIntentHandlder(); |
| | | var handler = new SiriKit.HDLRunSceneIntentHandlder(); |
| | | handler.HandleRunScene(intent, (response) => { |
| | | if (response.Code != HDLRunSceneIntentResponseCode.Success) |
| | | if (response.Code != HDLSceneSiri.HDLRunSceneIntentResponseCode.Success) |
| | | { |
| | | Console.WriteLine("Quantity must be greater than 0 to add to order"); |
| | | Console.WriteLine("Siri执行失败。"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | //var segue = OrderHistoryTableViewController.SegueIdentifiers.SoupMenu; |
| | | //orderHistoryViewController.PerformSegue(segue, null); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |