Flutter端和Android端增加removeUsedApplet api;

master
yangbingqiao 2021-09-03 12:26:19 +08:00
parent 4518144257
commit acf9c54463
2 changed files with 15 additions and 2 deletions

View File

@ -19,7 +19,7 @@ public class AppletManageModule extends BaseApi {
@Override @Override
public String[] apis() { public String[] apis() {
return new String[]{"currentApplet", "closeAllApplets", "clearApplets"}; return new String[]{"currentApplet", "closeAllApplets", "clearApplets", "removeUsedApplet"};
} }
@Override @Override
@ -49,6 +49,14 @@ public class AppletManageModule extends BaseApi {
} else if (event.equals("clearApplets")) { } else if (event.equals("clearApplets")) {
FinAppClient.INSTANCE.getAppletApiManager().clearApplets(); FinAppClient.INSTANCE.getAppletApiManager().clearApplets();
callback.onSuccess(null); callback.onSuccess(null);
} else if (event.equals("removeUsedApplet")) {
if (param.containsKey("appId") && param.get("appId") instanceof String) {
String appId = (String) param.get("appId");
FinAppClient.INSTANCE.getAppletApiManager().removeUsedApplet(appId);
callback.onSuccess(null);
} else {
callback.onFail(null);
}
} }
} }
} }

View File

@ -1,5 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'dart:math';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:mop/api.dart'; import 'package:mop/api.dart';
@ -156,6 +155,12 @@ class Mop {
return await _channel.invokeMethod("clearApplets"); return await _channel.invokeMethod("clearApplets");
} }
///
Future removeUsedApplet(String appId) async {
Map<String, Object> params = {'appId': appId};
return await _channel.invokeMethod("removeUsedApplet", params);
}
/// ///
/// ///
/// ///