Flutter端和Android端增加removeUsedApplet api;
parent
4518144257
commit
acf9c54463
|
@ -19,7 +19,7 @@ public class AppletManageModule extends BaseApi {
|
|||
|
||||
@Override
|
||||
public String[] apis() {
|
||||
return new String[]{"currentApplet", "closeAllApplets", "clearApplets"};
|
||||
return new String[]{"currentApplet", "closeAllApplets", "clearApplets", "removeUsedApplet"};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -49,6 +49,14 @@ public class AppletManageModule extends BaseApi {
|
|||
} else if (event.equals("clearApplets")) {
|
||||
FinAppClient.INSTANCE.getAppletApiManager().clearApplets();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:mop/api.dart';
|
||||
|
@ -156,6 +155,12 @@ class Mop {
|
|||
return await _channel.invokeMethod("clearApplets");
|
||||
}
|
||||
|
||||
/// 清除指定的小程序本体缓存
|
||||
Future removeUsedApplet(String appId) async {
|
||||
Map<String, Object> params = {'appId': appId};
|
||||
return await _channel.invokeMethod("removeUsedApplet", params);
|
||||
}
|
||||
|
||||
///
|
||||
/// 获取运行时版本号
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue