From 06c09ecbdf83cc5cc33971ffb75ba81e85b6eb33 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 29 十一月 2021 15:31:26 +0800
Subject: [PATCH] 2021-11-29 1.更新
---
HDLSceneSiriDemo/HDLSceneSiri/HDLSceneHandler.m | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/HDLSceneSiriDemo/HDLSceneSiri/HDLSceneHandler.m b/HDLSceneSiriDemo/HDLSceneSiri/HDLSceneHandler.m
index 8f18005..39b9b2a 100644
--- a/HDLSceneSiriDemo/HDLSceneSiri/HDLSceneHandler.m
+++ b/HDLSceneSiriDemo/HDLSceneSiri/HDLSceneHandler.m
@@ -17,6 +17,8 @@
// 寤鸿锛氬彧鐢╮eday鍜宻uccess 杩欎袱涓猚ode
- (void)confirmRunScene:(HDLRunSceneIntent *)intent completion:(void (^)(HDLRunSceneIntentResponse *response))completion NS_SWIFT_NAME(confirm(intent:completion:)){
+
+
HDLRunSceneIntentResponse *rsp = [[HDLRunSceneIntentResponse alloc] initWithCode:HDLRunSceneIntentResponseCodeInProgress userActivity:nil];
rsp.successMessage =@"璇风瓑寰�...";
completion(rsp);
@@ -24,10 +26,23 @@
- (void)handleHDLRunScene:(nonnull HDLRunSceneIntent *)intent completion:(nonnull void (^)(HDLRunSceneIntentResponse * _Nonnull))completion {
NSLog(@"HDL handleRunScene");
+ NSString *text = @"鎵ц鎴愬姛";
+
+
+ NSData *jsonData = [intent.controlJSONStr dataUsingEncoding:NSUTF8StringEncoding];
+ NSError *error;
+ NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&error];
+ if (error) {
+ //瑙f瀽鍑洪敊
+ }
+ NSLog(@"dic :%@",dic);
+ text = [NSString stringWithFormat:@"%@ %@",text,intent.controlJSONStr];
+
+
//鎵ц鎴愬姛
HDLRunSceneIntentResponse *rsp = [[HDLRunSceneIntentResponse alloc] initWithCode:HDLRunSceneIntentResponseCodeSuccess userActivity:nil];
- rsp.sceneName = intent.sceneName;
- rsp.successMessage = @"鎵ц鎴愬姛";
+ rsp.controlName = intent.controlName;
+ rsp.successMessage = text;
completion(rsp);
}
--
Gitblit v1.8.0