Merge remote-tracking branch 'origin/wechat-login' into wechat-login

master
cenxiaozhong 2022-05-19 17:45:13 +08:00
commit 0c285e6e5f
4 changed files with 17 additions and 0 deletions

View File

@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (instancetype)instance;
@property (nonatomic, copy) void (^bindGetPhoneNumber)(NSDictionary *dic);
@end
NS_ASSUME_NONNULL_END

View File

@ -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

View File

@ -24,6 +24,7 @@
dic[@"description"]=info.appDescription;
dic[@"version"] = info.appVersion;
dic[@"thumbnail"]=info.appThumbnail;
dic[@"wechatLoginInfo"]=info.wechatLoginInfo;
success(dic);
}
else

View File

@ -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;