Commit 45390cfc66ec156874eafbaf2ad40a1193ea4331
1 parent
065022b7
feat:失败回调
Showing
2 changed files
with
11 additions
and
4 deletions
ios/Runner.xcodeproj/project.pbxproj
... | ... | @@ -503,6 +503,7 @@ |
503 | 503 | "$(inherited)", |
504 | 504 | "@executable_path/Frameworks", |
505 | 505 | ); |
506 | + MARKETING_VERSION = 1.0; | |
506 | 507 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; |
507 | 508 | PRODUCT_NAME = "$(TARGET_NAME)"; |
508 | 509 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; |
... | ... | @@ -687,6 +688,7 @@ |
687 | 688 | "$(inherited)", |
688 | 689 | "@executable_path/Frameworks", |
689 | 690 | ); |
691 | + MARKETING_VERSION = 1.0; | |
690 | 692 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; |
691 | 693 | PRODUCT_NAME = "$(TARGET_NAME)"; |
692 | 694 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; |
... | ... | @@ -715,6 +717,7 @@ |
715 | 717 | "$(inherited)", |
716 | 718 | "@executable_path/Frameworks", |
717 | 719 | ); |
720 | + MARKETING_VERSION = 1.0; | |
718 | 721 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; |
719 | 722 | PRODUCT_NAME = "$(TARGET_NAME)"; |
720 | 723 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; | ... | ... |
ios/Runner/XSMessageMehtodChannel.swift
... | ... | @@ -82,7 +82,7 @@ class XSMessageMehtodChannel: NSObject,SSOralEvaluatingManagerDelegate { |
82 | 82 | */ |
83 | 83 | func oralEvaluatingDidStart() { |
84 | 84 | print("评测开始") |
85 | -// messageChannel!.invokeMethod("voiceStart", arguments: nil) | |
85 | + messageChannel!.invokeMethod("voiceStart", arguments: nil) | |
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
... | ... | @@ -90,14 +90,14 @@ class XSMessageMehtodChannel: NSObject,SSOralEvaluatingManagerDelegate { |
90 | 90 | */ |
91 | 91 | func oralEvaluatingDidStop() { |
92 | 92 | print("评测结束") |
93 | -// messageChannel!.invokeMethod("voiceEnd",arguments: nil) | |
93 | + messageChannel!.invokeMethod("voiceEnd",arguments: nil) | |
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
97 | 97 | 评测完成后的结果 |
98 | 98 | */ |
99 | 99 | func oralEvaluatingDidEnd(withResult result: [AnyHashable : Any]?, requestId request_id: String?) { |
100 | - var resultDict:Dictionary<String, Any> = result as! Dictionary | |
100 | + let resultDict:Dictionary<String, Any> = result as! Dictionary | |
101 | 101 | resultData! = resultDict; |
102 | 102 | self.evaluateResult() |
103 | 103 | } |
... | ... | @@ -106,7 +106,11 @@ class XSMessageMehtodChannel: NSObject,SSOralEvaluatingManagerDelegate { |
106 | 106 | 评测失败回调 |
107 | 107 | */ |
108 | 108 | func oralEvaluatingDidEndError(_ error: Error?, requestId request_id: String?) { |
109 | - messageChannel!.invokeMethod("voiceFail", arguments: error?.localizedDescription) | |
109 | + let nsError = error as? NSError | |
110 | + var map = Dictionary<String, Any>() | |
111 | + map["code"] = nsError?.code | |
112 | + map["message"] = error?.localizedDescription | |
113 | + messageChannel!.invokeMethod("voiceFail", arguments:map) | |
110 | 114 | } |
111 | 115 | |
112 | 116 | /** | ... | ... |