diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index 82f3b4b..c16385a 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"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-06-02 15:20:44.412374","version":"2.3.0-1.0.pre.169"} \ No newline at end of file +{"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-06-09 21:47:48.185375","version":"2.0.3"} \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index 37d6b64..c46bddd 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.flutter-io.cn" source: hosted - version: "2.6.0" + version: "2.5.0" boolean_selector: dependency: transitive description: @@ -87,7 +87,7 @@ packages: path: ".." relative: true source: path - version: "2.28.1" + version: "2.29.3" path: dependency: transitive description: @@ -106,7 +106,7 @@ packages: name: source_span url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.1" + version: "1.8.0" stack_trace: dependency: transitive description: @@ -141,7 +141,7 @@ packages: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.0" + version: "0.2.19" typed_data: dependency: transitive description: @@ -157,5 +157,5 @@ packages: source: hosted version: "2.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.12.0-0.0 <3.0.0" flutter: ">=1.10.0" diff --git a/ios/Classes/Api/MOP_scanOpenApplet.h b/ios/Classes/Api/MOP_scanOpenApplet.h index d6e423b..797e68d 100644 --- a/ios/Classes/Api/MOP_scanOpenApplet.h +++ b/ios/Classes/Api/MOP_scanOpenApplet.h @@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN @interface MOP_scanOpenApplet : MOPBaseApi +@property (nonatomic,copy) NSString *info; + @end NS_ASSUME_NONNULL_END diff --git a/ios/Classes/Api/MOP_scanOpenApplet.m b/ios/Classes/Api/MOP_scanOpenApplet.m index 86e0631..2d6e543 100644 --- a/ios/Classes/Api/MOP_scanOpenApplet.m +++ b/ios/Classes/Api/MOP_scanOpenApplet.m @@ -6,12 +6,24 @@ // #import "MOP_scanOpenApplet.h" +#import "MOPTools.h" #import @implementation MOP_scanOpenApplet - (void)setupApiWithSuccess:(void (^)(NSDictionary * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel { - NSLog(@"MOP_scanOpenApplet"); + NSLog(@"MOP_scanOpenApplet:%@", self.info); + FATAppletDecryptRequest *req = [[FATAppletDecryptRequest alloc] init]; + req.info = self.info; + UIViewController *currentVC = [MOPTools topViewController]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [[FATClient sharedClient] startAppletWithDecryptRequest:req InParentViewController:currentVC completion:^(BOOL result, FATError *error) { + NSLog(@"打开小程序:%@", error); + } closeCompletion:^{ + NSLog(@"关闭小程序"); + }]; + }); + } @end diff --git a/lib/mop.dart b/lib/mop.dart index fd8aa9e..0b30f08 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -161,7 +161,8 @@ class Mop { /// (扫码后)解密-鉴权-打开小程序 /// Future scanOpenApplet(String info) async { - return await _channel.invokeMapMethod("scanOpenApplet"); + Map params = {'info': info}; + return await _channel.invokeMapMethod("scanOpenApplet", params); } ///