diff --git a/ios/Classes/Api/MOPAppletDelegate.h b/ios/Classes/Api/MOPAppletDelegate.h index 0fab813..ec851e7 100644 --- a/ios/Classes/Api/MOPAppletDelegate.h +++ b/ios/Classes/Api/MOPAppletDelegate.h @@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)instance; +@property (nonatomic, copy) void (^bindGetPhoneNumber)(NSDictionary *dic); + @end NS_ASSUME_NONNULL_END diff --git a/ios/Classes/Api/MOPAppletDelegate.m b/ios/Classes/Api/MOPAppletDelegate.m index 00322f6..01236af 100644 --- a/ios/Classes/Api/MOPAppletDelegate.m +++ b/ios/Classes/Api/MOPAppletDelegate.m @@ -133,6 +133,14 @@ static NSString *scheme = @"fatae55433be2f62915";//App对应的scheme [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; } +- (void)getPhoneNumberWithAppletInfo:(FATAppletInfo *)appletInfo bindGetPhoneNumber:(void (^)(NSDictionary *))bindGetPhoneNumber { + self.bindGetPhoneNumber = bindGetPhoneNumber; + FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; + [channel invokeMethod:@"extensionApi:getPhoneNumber" arguments:@{} result:^(id _Nullable result) { + + }]; + +} @end diff --git a/ios/Classes/Api/MOP_currentApplet.m b/ios/Classes/Api/MOP_currentApplet.m index bfbd498..75e0ccc 100644 --- a/ios/Classes/Api/MOP_currentApplet.m +++ b/ios/Classes/Api/MOP_currentApplet.m @@ -24,6 +24,7 @@ dic[@"description"]=info.appDescription; dic[@"version"] = info.appVersion; dic[@"thumbnail"]=info.appThumbnail; + dic[@"wechatLoginInfo"]=info.wechatLoginInfo; success(dic); } else diff --git a/ios/Classes/MopPlugin.m b/ios/Classes/MopPlugin.m index 8d14672..3796d83 100644 --- a/ios/Classes/MopPlugin.m +++ b/ios/Classes/MopPlugin.m @@ -2,6 +2,7 @@ #import "MOPBaseApi.h" #import "MOPApiRequest.h" #import "MOPApiConverter.h" +#import "MOPAppletDelegate.h" @implementation MopEventStream { FlutterEventSink _eventSink; @@ -75,6 +76,11 @@ static MopPlugin *_instance; dict[@"path"] = [[FATClient sharedClient] fat_absolutePathWithPath:path]; result(dict); } + else if ([@"getPhoneNumberResult" isEqualToString:call.method]) { + if ([MOPAppletDelegate instance].bindGetPhoneNumber) { + [MOPAppletDelegate instance].bindGetPhoneNumber(call.arguments); + } + } else { MOPApiRequest* request = [[MOPApiRequest alloc] init]; request.command = call.method;