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,6 +503,7 @@ | ||
| 503 | "$(inherited)", | 503 | "$(inherited)", |
| 504 | "@executable_path/Frameworks", | 504 | "@executable_path/Frameworks", |
| 505 | ); | 505 | ); |
| 506 | + MARKETING_VERSION = 1.0; | ||
| 506 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; | 507 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; |
| 507 | PRODUCT_NAME = "$(TARGET_NAME)"; | 508 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 508 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; | 509 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; |
| @@ -687,6 +688,7 @@ | @@ -687,6 +688,7 @@ | ||
| 687 | "$(inherited)", | 688 | "$(inherited)", |
| 688 | "@executable_path/Frameworks", | 689 | "@executable_path/Frameworks", |
| 689 | ); | 690 | ); |
| 691 | + MARKETING_VERSION = 1.0; | ||
| 690 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; | 692 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; |
| 691 | PRODUCT_NAME = "$(TARGET_NAME)"; | 693 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 692 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; | 694 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; |
| @@ -715,6 +717,7 @@ | @@ -715,6 +717,7 @@ | ||
| 715 | "$(inherited)", | 717 | "$(inherited)", |
| 716 | "@executable_path/Frameworks", | 718 | "@executable_path/Frameworks", |
| 717 | ); | 719 | ); |
| 720 | + MARKETING_VERSION = 1.0; | ||
| 718 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; | 721 | PRODUCT_BUNDLE_IDENTIFIER = com.kouyuxingqiu.wowenglish; |
| 719 | PRODUCT_NAME = "$(TARGET_NAME)"; | 722 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 720 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; | 723 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; |
ios/Runner/XSMessageMehtodChannel.swift
| @@ -82,7 +82,7 @@ class XSMessageMehtodChannel: NSObject,SSOralEvaluatingManagerDelegate { | @@ -82,7 +82,7 @@ class XSMessageMehtodChannel: NSObject,SSOralEvaluatingManagerDelegate { | ||
| 82 | */ | 82 | */ |
| 83 | func oralEvaluatingDidStart() { | 83 | func oralEvaluatingDidStart() { |
| 84 | print("评测开始") | 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,14 +90,14 @@ class XSMessageMehtodChannel: NSObject,SSOralEvaluatingManagerDelegate { | ||
| 90 | */ | 90 | */ |
| 91 | func oralEvaluatingDidStop() { | 91 | func oralEvaluatingDidStop() { |
| 92 | print("评测结束") | 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 | func oralEvaluatingDidEnd(withResult result: [AnyHashable : Any]?, requestId request_id: String?) { | 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 | resultData! = resultDict; | 101 | resultData! = resultDict; |
| 102 | self.evaluateResult() | 102 | self.evaluateResult() |
| 103 | } | 103 | } |
| @@ -106,7 +106,11 @@ class XSMessageMehtodChannel: NSObject,SSOralEvaluatingManagerDelegate { | @@ -106,7 +106,11 @@ class XSMessageMehtodChannel: NSObject,SSOralEvaluatingManagerDelegate { | ||
| 106 | 评测失败回调 | 106 | 评测失败回调 |
| 107 | */ | 107 | */ |
| 108 | func oralEvaluatingDidEndError(_ error: Error?, requestId request_id: String?) { | 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 | /** |