From 1446c77149fd86515e493b44fb9c5cf07b739d96 Mon Sep 17 00:00:00 2001 From: Stewen <784547228@qq.com> Date: Fri, 15 Sep 2023 18:58:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5finclip=E7=9A=84=E5=88=B02.41?= =?UTF-8?q?.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 4 +- .../mop/api/mop/AppletHandlerModule.java | 62 +++++++++++++++++++ ios/mop.podspec | 4 +- pubspec.yaml | 2 +- 4 files changed, 67 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index a70578e..56c5c8d 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.41.5' - implementation 'com.finogeeks.mop:plugins:2.41.5' + implementation 'com.finogeeks.lib:finapplet:2.41.11' + implementation 'com.finogeeks.mop:plugins:2.41.11' } \ No newline at end of file diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java index 84b586d..331d2b2 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java @@ -26,6 +26,8 @@ import com.finogeeks.mop.utils.AppletUtils; import com.finogeeks.mop.utils.GsonUtil; import com.finogeeks.mop.impls.MyUserProfileHandler; import com.google.gson.reflect.TypeToken; +import com.finogeeks.lib.applet.sdk.api.IAppletLifecycleCallback; + import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -69,6 +71,66 @@ public class AppletHandlerModule extends BaseApi { // getUserProfile的内置实现 FinAppClient.INSTANCE.getFinAppConfig().setGetUserProfileHandlerClass(MyUserProfileHandler.class.getName()); + FinAppClient.INSTANCE.getAppletApiManager().setAppletLifecycleCallback(new IAppletLifecycleCallback() { + + @Override + public void onCreate(@NotNull String appId) { + Log.d(TAG, "IAppletLifecycleCallback onCreate : " + appId); + } + + @Override + public void onInitComplete(@NotNull String appId) { + Log.d(TAG, "IAppletLifecycleCallback onInitComplete : " + appId); + Map params = new HashMap<>(); + params.put("appId", appId); + handler.post(() -> { + channel.invokeMethod("extensionApi:appletDidOpen", params, new MethodChannel.Result() { + @Override + public void success(Object result) { + } + + @Override + public void error(String errorCode, String errorMessage, Object errorDetails) { + } + + @Override + public void notImplemented() { + } + }); + }); + } + + @Override + public void onStart(@NotNull String appId) { + Log.d(TAG, "IAppletLifecycleCallback onStart : " + appId); + } + + @Override + public void onResume(@NotNull String appId) { + Log.d(TAG, "IAppletLifecycleCallback onResume : " + appId); + } + + @Override + public void onPause(@NotNull String appId) { + Log.d(TAG, "IAppletLifecycleCallback onPause : " + appId); + } + + @Override + public void onStop(@NotNull String appId) { + Log.d(TAG, "IAppletLifecycleCallback onStop : " + appId); + } + + @Override + public void onDestroy(@NotNull String appId) { + Log.d(TAG, "IAppletLifecycleCallback onDestroy : " + appId); + } + + @Override + public void onFailure(@NotNull String appId, String errMsg) { + Log.d(TAG, "IAppletLifecycleCallback onFailure : " + appId); + } + }); + FinAppClient.INSTANCE.getAppletApiManager().setAppletHandler(mIAppletHandler = new IAppletHandler() { @Nullable diff --git a/ios/mop.podspec b/ios/mop.podspec index 1934d12..b887f85 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk. s.dependency 'Flutter' s.ios.deployment_target = '9.0' - s.dependency 'FinApplet' , '2.41.5' - s.dependency 'FinAppletExt' , '2.41.5' + s.dependency 'FinApplet' , '2.41.11' + s.dependency 'FinAppletExt' , '2.41.11' end diff --git a/pubspec.yaml b/pubspec.yaml index 2bd9e07..67e1ed0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mop description: A Finogeeks MiniProgram Flutter SDK. -version: '2.41.5' +version: '2.41.11' homepage: https://github.com/finogeeks/mop-flutter-sdk environment: