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: