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

50 lines
1.4 KiB
Dart
Raw Normal View History

2020-04-26 14:57:08 +08:00
//
// MOP_currentApplet.m
// mop
//
// Created by 康旭耀 on 2020/4/16.
//
#import "MOP_currentApplet.h"
#import <FinApplet/FinApplet.h>
@implementation MOP_currentApplet
- (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *,id> * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel
{
FATAppletInfo *info = [[FATClient sharedClient] currentApplet];
if(info != nil)
{
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
dic[@"appId"] = info.appId;
dic[@"name"]= info.appTitle;
dic[@"icon"]= info.appAvatar;
dic[@"description"]=info.appDescription;
dic[@"version"] = info.appVersion;
dic[@"thumbnail"]=info.appThumbnail;
2022-05-20 14:02:17 +08:00
dic[@"wechatLoginInfo"]=info.wechatLoginInfo;
2022-10-10 18:28:58 +08:00
if (info.appletVersionType == FATAppletVersionTypeRelease) {
dic[@"appletType"] = @"release";
} else if (info.appletVersionType == FATAppletVersionTypeTrial) {
dic[@"appletType"] = @"trial";
} else if (info.appletVersionType == FATAppletVersionTypeTemporary) {
dic[@"appletType"] = @"temporary";
} else if (info.appletVersionType == FATAppletVersionTypeReview) {
dic[@"appletType"] = @"review";
} else {
dic[@"appletType"] = @"development";
}
2020-04-26 14:57:08 +08:00
success(dic);
2022-10-10 18:28:58 +08:00
} else {
2020-04-26 14:57:08 +08:00
success(@{});
}
}
2022-05-17 11:23:32 +08:00
+ (void)load {
}
2020-04-26 14:57:08 +08:00
@end