mop-flutter-sdk/ios/Classes/Api/MOP_openApplet.m

41 lines
1.2 KiB
Dart
Raw Normal View History

2020-02-27 17:21:45 +08:00
//
// MOP_openApplet.m
// mop
//
// Created by 杨涛 on 2020/2/27.
//
#import "MOP_openApplet.h"
#import "MOPTools.h"
#import <FinApplet/FinApplet.h>
@implementation MOP_openApplet
- (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *,id> * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel
{
UIViewController *currentVC = [MOPTools topViewController];
// 打开小程序
2020-04-01 14:44:01 +08:00
if (self.sequence == nil) {
2020-02-27 17:21:45 +08:00
[[FATClient sharedClient] startRemoteApplet:self.appId startParams:self.params InParentViewController:currentVC completion:^(BOOL result, NSError *error) {
NSLog(@"result:%d---error:%@", result, error);
if (result){
success(@{});
}else {
failure(error.description);
}
}];
2020-04-01 14:44:01 +08:00
}else{
2020-11-25 11:52:53 +08:00
[[FATClient sharedClient] startRemoteApplet:self.appId sequence:self.sequence startParams:self.params InParentViewController:currentVC transitionStyle:FATTranstionStyleUp animated:YES completion:^(BOOL result, NSError *error) {
2020-04-01 14:44:01 +08:00
NSLog(@"result:%d---error:%@", result, error);
if (result){
success(@{});
}else {
failure(error.description);
}
}];
2020-10-27 16:31:29 +08:00
2020-04-01 14:44:01 +08:00
}
2020-02-27 17:21:45 +08:00
}
@end