phiz_2.42.13.3
Sean 2023-12-25 15:22:17 +08:00
parent b06d277742
commit 30ec953383
1 changed files with 8 additions and 4 deletions

View File

@ -25,10 +25,14 @@ public class ExtensionApiModule extends BaseApi {
private static final String TAG = "ExtensionApiModule";
private final Context cur;
private Handler handler = new Handler(Looper.getMainLooper());
public ExtensionApiModule(Context context) {
super(context);
cur = context;
}
@Override
@ -38,13 +42,13 @@ public class ExtensionApiModule extends BaseApi {
@Override
public void invoke(String s, Map param, ICallback iCallback) {
boolean isFinAppProcess = FinAppClient.INSTANCE.isFinAppProcess(getContext());
boolean isFinAppProcess = FinAppClient.INSTANCE.isFinAppProcess(cur);
Log.d(TAG, "ExtensionApiModule invoke register api s:" + s + " param:" + param +" isFinAppProcess:"+isFinAppProcess);
if(s.equals("registerExtensionApi")) {
MethodChannel channel = MopPluginService.getInstance().getMethodChannel();
String name = (String) param.get("name");
Log.d(TAG, "registerExtensionApi:" + name);
FinAppClient.INSTANCE.getExtensionApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(getContext()) {
FinAppClient.INSTANCE.getExtensionApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(cur) {
@Override
public String[] apis() {
return new String[]{name};
@ -101,7 +105,7 @@ public class ExtensionApiModule extends BaseApi {
MethodChannel channel = MopPluginService.getInstance().getMethodChannel();
String name = (String) param.get("name");
Log.d(TAG, "registerSyncExtensionApi:" + name);
FinAppClient.INSTANCE.getExtensionApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(getContext()) {
FinAppClient.INSTANCE.getExtensionApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(cur) {
@Override
public String[] apis() {
return new String[]{name};
@ -158,7 +162,7 @@ public class ExtensionApiModule extends BaseApi {
MethodChannel channel = MopPluginService.getInstance().getMethodChannel();
String name = (String) param.get("name");
Log.d(TAG, "addWebExtentionApi:" + name);
FinAppClient.INSTANCE.getExtensionWebApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(getContext()) {
FinAppClient.INSTANCE.getExtensionWebApiManager().registerApi(new com.finogeeks.lib.applet.api.BaseApi(cur) {
@Override
public String[] apis() {
return new String[]{name};