From 52756efc50f7c1f70a576a38cb183426986d900f Mon Sep 17 00:00:00 2001 From: jizelin Date: Thu, 31 Mar 2022 15:50:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=8F=9C=E5=8D=95ios?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Classes/Api/MOPAppletDelegate.m | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/ios/Classes/Api/MOPAppletDelegate.m b/ios/Classes/Api/MOPAppletDelegate.m index dab0502..00322f6 100644 --- a/ios/Classes/Api/MOPAppletDelegate.m +++ b/ios/Classes/Api/MOPAppletDelegate.m @@ -84,11 +84,11 @@ return models; } -- (void)customMenu:(id)customMenu inApplet:(FATAppletInfo *)appletInfo didClickAtPath:(NSString *)path { +- (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo inApplet:(FATAppletInfo *)appletInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion { NSDictionary *arguments = @{ - @"appId": appletInfo.appId, - @"path": path, - @"menuId": customMenu.menuId, + @"appId": contentInfo[@"appId"], + @"path": contentInfo[@"path"], + @"menuId": contentInfo[@"menuId"], @"appInfo": appletInfo.description }; FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; @@ -96,26 +96,6 @@ }]; - if ([@"Desktop" isEqualToString:customMenu.menuId]) { - [self addToDesktopItemClick:appletInfo path:path]; - } - -} - -- (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion { - NSDictionary *arguments = @{ - @"appId": contentInfo[@"appId"], - @"path": contentInfo[@"path"], - @"menuId": contentInfo[@"menuId"], - @"appInfo": [NSString stringWithFormat:@"{'title': '%@', 'description': '%@', 'imageUrl': '%@'}", contentInfo[@"title"], contentInfo[@"description"], contentInfo[@"imageUrl"]] - }; - FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; - [channel invokeMethod:@"extensionApi:onCustomMenuClick" arguments:arguments result:^(id _Nullable result) { - - }]; -} - -- (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo inApplet:(FATAppletInfo *)appletInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion { if ([@"Desktop" isEqualToString:contentInfo[@"menuId"]]) { [self addToDesktopItemClick:appletInfo path:contentInfo[@"path"]]; }