add 二维码打开小程序

master
wanghualei 2021-12-29 10:11:50 +08:00
parent f9a5f9d079
commit 8837bd5614
6 changed files with 64 additions and 4 deletions

View File

@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/beetle/Desktop/finogeeks/gitlab/finosprite/finclip-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2021-11-15 23:44:20.482386","version":"2.2.2"} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/haley/Documents/Finogeeks/Gitlab/finclip-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/haley/Documents/Finogeeks/Gitlab/finclip-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2021-12-29 10:07:33.662750","version":"2.3.0-1.0.pre.169"}

View File

@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>

View File

@ -0,0 +1,18 @@
//
// MOP_scanOpenApplet.h
// mop
//
// Created by beetle_92 on 2021/6/7.
//
#import "MOPBaseApi.h"
NS_ASSUME_NONNULL_BEGIN
@interface MOP_qrcodeOpenApplet : MOPBaseApi
@property (nonatomic,copy) NSString *qrcode;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,37 @@
//
// MOP_scanOpenApplet.m
// mop
//
// Created by beetle_92 on 2021/6/7.
//
#import "MOP_qrcodeOpenApplet.h"
#import "MOPTools.h"
#import <FinApplet/FinApplet.h>
@implementation MOP_qrcodeOpenApplet
- (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *,id> * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel {
NSLog(@"MOP_qrcodeOpenApplet:%@", self.qrcode);
FATAppletQrCodeRequest *qrcodeRequest = [[FATAppletQrCodeRequest alloc] init];
qrcodeRequest.qrCode = self.qrcode;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
UIViewController *currentVC = [MOPTools topViewController];
[[FATClient sharedClient] startAppletWithQrCodeRequest:qrcodeRequest inParentViewController:currentVC requestBlock:^(BOOL result, FATError *error) {
NSLog(@"请求完成:%@", error);
} completion:^(BOOL result, FATError *error) {
NSLog(@"打开完成:%@", error);
if (result){
success(@{});
} else {
failure(error.description);
}
} closeCompletion:^{
NSLog(@"关闭");
}];
});
}
@end

View File

@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk.
s.dependency 'Flutter' s.dependency 'Flutter'
s.ios.deployment_target = '9.0' s.ios.deployment_target = '9.0'
s.dependency 'FinApplet' , '2.34.12' s.dependency 'FinApplet' , '2.35.0-alpha20211229v02'
s.dependency 'FinAppletExt' , '2.34.12' s.dependency 'FinAppletExt' , '2.35.0-alpha20211229v02'
end end

View File

@ -178,6 +178,11 @@ class Mop {
return await _channel.invokeMapMethod("scanOpenApplet", params); return await _channel.invokeMapMethod("scanOpenApplet", params);
} }
Future qrcodeOpenApplet(String qrcode) async {
Map<String, Object> params = {'qrcode': qrcode};
return await _channel.invokeMapMethod("qrcodeOpenApplet", params);
}
/// ///
/// QrCode /// QrCode
/// ///