diff --git a/android/build.gradle b/android/build.gradle index 8870e78..7b5b834 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -91,6 +91,6 @@ kapt { } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.finogeeks.lib:finapplet:2.13.13' - implementation 'com.finogeeks.mop:plugins:0.0.23' + implementation 'com.finogeeks.lib:finapplet:2.13.29' + implementation 'com.finogeeks.mop:plugins:0.0.26' } \ No newline at end of file diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java index 6dff660..b35821e 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java @@ -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; diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java index afb73b9..9d6384c 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/BaseModule.java @@ -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())) { - // 小程序进程不执行任何初始化操作 + // 扩展SDK的API都注册到小程序进程 + FinAppProcessClient.INSTANCE.setCallback(new FinAppProcessClient.Callback() { + @Nullable + @Override + public List getRegisterExtensionApis(@NotNull Activity activity) { + return FinPluginClient.INSTANCE.getPluginManager().getPlugins(activity); + } + + @Nullable + @Override + public List 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); } diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index 8a697b2..c2d658b 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/hujianhui/Desktop/fantaizhushou/mop-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/hujianhui/Desktop/fantaizhushou/mop-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2020-12-12 15:40:41.141320","version":"1.22.4"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/haley/Documents/Finogeeks/Flutter/mop-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/haley/Documents/Finogeeks/Flutter/mop-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2020-12-01 10:11:53.132361","version":"1.24.0-8.0.pre.140"} \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index eb9da1e..9545068 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,42 +7,42 @@ packages: name: async url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.1" + version: "2.5.0-nullsafety.3" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.1.0-nullsafety.3" characters: dependency: transitive description: name: characters url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.0" + version: "1.1.0-nullsafety.5" charcode: dependency: transitive description: name: charcode url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.3" + version: "1.2.0-nullsafety.3" clock: dependency: transitive description: name: clock url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.1" + version: "1.1.0-nullsafety.3" collection: dependency: transitive description: name: collection url: "https://pub.flutter-io.cn" source: hosted - version: "1.14.12" + version: "1.15.0-nullsafety.5" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.2.0-nullsafety.3" flutter: dependency: "direct main" description: flutter @@ -73,14 +73,14 @@ packages: name: matcher url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.6" + version: "0.12.10-nullsafety.3" meta: dependency: transitive description: name: meta url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.8" + version: "1.3.0-nullsafety.6" mop: dependency: "direct dev" description: @@ -94,7 +94,7 @@ packages: name: path url: "https://pub.flutter-io.cn" source: hosted - version: "1.7.0" + version: "1.8.0-nullsafety.3" sky_engine: dependency: transitive description: flutter @@ -106,55 +106,55 @@ packages: name: source_span url: "https://pub.flutter-io.cn" source: hosted - version: "1.7.0" + version: "1.8.0-nullsafety.4" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.flutter-io.cn" source: hosted - version: "1.9.3" + version: "1.10.0-nullsafety.6" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.1.0-nullsafety.3" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.5" + version: "1.1.0-nullsafety.3" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.2.0-nullsafety.3" test_api: dependency: transitive description: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.16" + version: "0.2.19-nullsafety.6" typed_data: dependency: transitive description: name: typed_data url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.6" + version: "1.3.0-nullsafety.5" vector_math: dependency: transitive description: name: vector_math url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.8" + version: "2.1.0-nullsafety.5" sdks: - dart: ">=2.9.0-14.0.dev <3.0.0" + dart: ">=2.12.0-0.0 <3.0.0" diff --git a/ios/Classes/Api/MOP_initialize.m b/ios/Classes/Api/MOP_initialize.m index cfd6121..0bdbf59 100644 --- a/ios/Classes/Api/MOP_initialize.m +++ b/ios/Classes/Api/MOP_initialize.m @@ -7,6 +7,7 @@ #import "MOP_initialize.h" #import +#import @implementation MOP_initialize @@ -44,6 +45,7 @@ failure(@"初始化失败"); return; } + [[FATExtClient sharedClient] fat_prepareExtensionApis]; success(@{}); diff --git a/ios/mop.podspec b/ios/mop.podspec index f055212..0efb346 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -17,7 +17,7 @@ A new flutter plugin project. s.dependency 'Flutter' s.ios.deployment_target = '8.0' - s.dependency 'FinApplet' , '2.12.65' - s.dependency 'FinAppletExt' , '2.12.65' + s.dependency 'FinApplet' , '2.13.16' + s.dependency 'FinAppletExt' , '2.13.16' end