46
46
import io .flutter .plugin .common .MethodChannel .Result ;
47
47
import io .flutter .plugin .common .PluginRegistry .Registrar ;
48
48
49
- class JVRequestItem {
50
- public MethodCall call ;
51
- Result result ;
52
- }
49
+
53
50
54
51
/** JverifyPlugin */
55
52
public class JverifyPlugin implements MethodCallHandler {
@@ -74,7 +71,6 @@ public class JverifyPlugin implements MethodCallHandler {
74
71
75
72
private Context context ;
76
73
private MethodChannel channel ;
77
- private HashMap <String ,JVRequestItem > requestQueue = new HashMap ();
78
74
79
75
/** Plugin registration. */
80
76
public static void registerWith (Registrar registrar ) {
@@ -92,28 +88,6 @@ private JverifyPlugin(Registrar registrar,MethodChannel channel){
92
88
public void onMethodCall (MethodCall call , Result result ) {
93
89
Log .d (TAG ,"onMethodCall:" + call .method );
94
90
95
- // JVRequestItem item = requestQueue.get(call.method);
96
- // if (item == null) {
97
- // item = new JVRequestItem();
98
- // item.call = call;
99
- // item.result = result;
100
- //
101
- // requestQueue.put(call.method,item);
102
- //
103
- // processMethod(call, result);
104
- // }else {
105
- // String error_repeat_desc = call.method + " is requesting, please try again later.";
106
- //
107
- // Map<String,Object> map = new HashMap<>();
108
- // map.put(j_code_key,j_error_code_repeat);
109
- // map.put(j_msg_key,error_repeat_desc);
110
- //
111
- // result.success(map);
112
- // }
113
- processMethod (call ,result );
114
- }
115
-
116
- private void processMethod (MethodCall call , Result result ) {
117
91
Log .d (TAG ,"processMethod:" + call .method );
118
92
if (call .method .equals ("setup" )) {
119
93
setup (call ,result );
@@ -149,17 +123,6 @@ private void processMethod(MethodCall call, Result result) {
149
123
}
150
124
}
151
125
152
- private void methodCallBack (Object object ,String method ) {
153
- Log .d (TAG ,"Action - methodCallBack:" + method );
154
-
155
- JVRequestItem item = requestQueue .get (method );
156
- if (item != null ) {
157
- if (item .result != null ) {
158
- item .result .success (object );
159
- }
160
- }
161
- requestQueue .remove (method );
162
- }
163
126
164
127
// 主线程再返回数据
165
128
private void runMainThread (final Map <String ,Object > map , final Result result , final String method ) {
0 commit comments