diff --git a/ios/Classes/Api/MOPAppletDelegate.m b/ios/Classes/Api/MOPAppletDelegate.m index c3ff701..d01d99a 100644 --- a/ios/Classes/Api/MOPAppletDelegate.m +++ b/ios/Classes/Api/MOPAppletDelegate.m @@ -102,4 +102,15 @@ }]; } +- (void)applet:(NSString *)appletId didOpenCompletion:(NSError *)error { + if (!appletId) { + return; + } + NSDictionary *params = @{@"appId":appletId}; + FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; + [channel invokeMethod:@"extensionApi:appletDidOpen" arguments:params result:^(id _Nullable result) { + + }]; +} + @end diff --git a/lib/api.dart b/lib/api.dart index f5e5f6f..f849c71 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -36,4 +36,7 @@ abstract class AppletHandler { ///自定义菜单点击处理 Future onCustomMenuClick( String appId, String path, String menuId, String appInfo); + + //打开小程序 + Future appletDidOpen(String appId); } diff --git a/lib/mop.dart b/lib/mop.dart index e155152..855078e 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -54,6 +54,8 @@ class Mop { if (handler != null) { return await handler(call.arguments); } + } else if (call.method.startsWith("extensionApi:")) { + } } @@ -217,6 +219,9 @@ class Mop { return handler.onCustomMenuClick( params["appId"], params["path"], params["menuId"], params["appInfo"]); }; + _extensionApis["appletDidOpen"] = (params) async { + return handler.appletDidOpen(params["appId"]); + }; _channel.invokeMethod("registerAppletHandler"); }