60 lines
1.6 KiB
Dart
60 lines
1.6 KiB
Dart
//
|
|
// MOPAppletDelegate.m
|
|
// mop
|
|
//
|
|
// Created by 康旭耀 on 2020/4/20.
|
|
//
|
|
|
|
#import "MOPAppletDelegate.h"
|
|
#import "MopPlugin.h"
|
|
|
|
@implementation MOPAppletDelegate
|
|
|
|
+ (instancetype)instance
|
|
{
|
|
static MOPAppletDelegate *_instance;
|
|
static dispatch_once_t once;
|
|
dispatch_once(&once, ^{
|
|
_instance = [[self alloc] init];
|
|
});
|
|
return _instance;
|
|
}
|
|
|
|
- (void)forwardAppletWithInfo:(NSDictionary *)contentInfo completion:(void (^)(FATExtensionCode, NSDictionary *))completion
|
|
{
|
|
NSLog(@"forwardAppletWithInfo:%@",contentInfo);
|
|
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
|
|
[channel invokeMethod:@"extensionApi:forwardApplet" arguments:@{@"appletInfo":contentInfo} result:^(id _Nullable result) {
|
|
if([result isKindOfClass:[FlutterError class]]|| [result isKindOfClass:[FlutterMethodNotImplemented class] ])
|
|
{
|
|
completion(FATExtensionCodeFailure,nil);
|
|
}else
|
|
{
|
|
completion(FATExtensionCodeSuccess,result);
|
|
}
|
|
}];
|
|
}
|
|
|
|
- (NSDictionary *)getUserInfoWithAppletInfo:(FATAppletInfo *)appletInfo
|
|
{
|
|
NSLog(@"getUserInfoWithAppletInfo");
|
|
__block NSDictionary *userInfo;
|
|
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
|
|
[channel invokeMethod:@"extensionApi:getUserInfo" arguments:nil result:^(id _Nullable result) {
|
|
userInfo = result;
|
|
}];
|
|
return userInfo;
|
|
}
|
|
|
|
- (NSArray<id<FATAppletMenuProtocol>> *)customMenusInMoreItemAtPath:(NSString *)path
|
|
{
|
|
return nil;
|
|
}
|
|
|
|
- (void)customMenu:(id<FATAppletMenuProtocol>)customMenu didClickAtPath:(NSString *)path
|
|
{
|
|
|
|
}
|
|
|
|
@end
|