调整扩展SDK中API的注册方式,都注册到小程序进程中

master
xiaoyu 2020-12-16 14:30:47 +08:00
parent 265d9bd19e
commit 97db208c08
3 changed files with 23 additions and 9 deletions

View File

@ -91,6 +91,6 @@ kapt {
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.finogeeks.lib:finapplet:2.13.25'
implementation 'com.finogeeks.mop:plugins:0.0.25'
implementation 'com.finogeeks.lib:finapplet:2.13.29'
implementation 'com.finogeeks.mop:plugins:0.0.26'
}

View File

@ -4,8 +4,6 @@ import android.content.Context;
import android.util.Log;
import com.finogeeks.lib.applet.client.FinAppClient;
import com.finogeeks.lib.applet.client.FinAppConfig;
import com.finogeeks.lib.applet.client.FinAppInfo;
import com.finogeeks.mop.api.BaseApi;
import com.finogeeks.mop.interfaces.ICallback;

View File

@ -1,20 +1,24 @@
package com.finogeeks.mop.api.mop;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.util.Log;
import android.widget.Toast;
import com.finogeeks.lib.applet.BuildConfig;
import com.finogeeks.lib.applet.client.FinAppClient;
import com.finogeeks.lib.applet.client.FinAppConfig;
import com.finogeeks.lib.applet.client.FinAppProcessClient;
import com.finogeeks.lib.applet.interfaces.FinCallback;
import com.finogeeks.lib.applet.interfaces.IApi;
import com.finogeeks.mop.api.BaseApi;
import com.finogeeks.mop.interfaces.ICallback;
import com.finogeeks.mop.plugins.client.FinPluginClient;
import com.finogeeks.mop.service.MopPluginService;
import java.util.HashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Map;
public class BaseModule extends BaseApi {
@ -39,7 +43,20 @@ public class BaseModule extends BaseApi {
public void invoke(String event, Map param, final ICallback callback) {
if (FinAppClient.INSTANCE.isFinAppProcess(super.getContext())) {
//
// SDKAPI
FinAppProcessClient.INSTANCE.setCallback(new FinAppProcessClient.Callback() {
@Nullable
@Override
public List<IApi> getRegisterExtensionApis(@NotNull Activity activity) {
return FinPluginClient.INSTANCE.getPluginManager().getPlugins(activity);
}
@Nullable
@Override
public List<IApi> getRegisterExtensionWebApis(@NotNull Activity activity) {
return null;
}
});
return;
}
String appkey = String.valueOf(param.get("appkey"));
@ -79,7 +96,6 @@ public class BaseModule extends BaseApi {
@Override
public void onSuccess(Object result) {
// SDK
FinPluginClient.INSTANCE.getPluginManager().registerPlugins(application);
callback.onSuccess(null);
}