From 6fb0b84b3d695903c70f51fbfeca33d47f7bd40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=81=A5=E8=BE=89?= <27-hujianhui@users.noreply.gitlab.gitlab.finogeeks.club> Date: Thu, 19 May 2022 14:55:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Classes/Api/MOPAppletDelegate.h | 2 ++ ios/Classes/Api/MOPAppletDelegate.m | 8 ++++++++ ios/Classes/Api/MOP_currentApplet.m | 1 + ios/Classes/MopPlugin.m | 6 ++++++ 4 files changed, 17 insertions(+) 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;