2020-02-22 11:21:27 +08:00
|
|
|
|
//
|
|
|
|
|
// AppDelegate.m
|
|
|
|
|
// demo
|
|
|
|
|
//
|
|
|
|
|
// Created by 杨涛 on 2020/2/6.
|
|
|
|
|
// Copyright © 2020 finogeeks. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "AppDelegate.h"
|
2022-04-21 10:52:28 +08:00
|
|
|
|
#import "MainViewController.h"
|
2020-12-04 14:09:34 +08:00
|
|
|
|
#import "FINExtensionHelper.h"
|
2020-12-18 09:28:26 +08:00
|
|
|
|
#import "FINDemoClientHelper.h"
|
2022-08-03 11:54:58 +08:00
|
|
|
|
|
2020-02-22 11:21:27 +08:00
|
|
|
|
#import <FinApplet/FinApplet.h>
|
2022-08-03 11:54:58 +08:00
|
|
|
|
#import <FinAppletBDMap/FinAppletBDMap.h>
|
|
|
|
|
#import <FinAppletGDMap/FinAppletGDMap.h>
|
2020-02-22 11:21:27 +08:00
|
|
|
|
|
|
|
|
|
@interface AppDelegate ()
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation AppDelegate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
|
|
|
|
// Override point for customization after application launch.
|
|
|
|
|
|
2021-08-19 19:47:47 +08:00
|
|
|
|
NSString *bundleId = [NSBundle mainBundle].bundleIdentifier;
|
|
|
|
|
NSString *path = [[NSBundle mainBundle] pathForResource:@"servers" ofType:@"plist"];
|
|
|
|
|
NSDictionary *servers = [NSDictionary dictionaryWithContentsOfFile:path];
|
2022-04-21 10:52:28 +08:00
|
|
|
|
NSArray *array = servers[bundleId];
|
|
|
|
|
NSMutableArray *configs = [NSMutableArray array];
|
|
|
|
|
for (NSDictionary *data in array) {
|
|
|
|
|
NSString *appKey = data[@"appKey"];
|
|
|
|
|
NSString *appSecret = data[@"appSecret"];
|
|
|
|
|
NSString *apiServer = data[@"apiServer"];
|
|
|
|
|
FATApiCryptType cryptType = [data[@"cryptType"] isEqualToString:@"MD5"] ? FATApiCryptTypeMD5 : FATApiCryptTypeSM;
|
|
|
|
|
FATStoreConfig *storeConfig = [[FATStoreConfig alloc] init];
|
|
|
|
|
storeConfig.sdkKey = appKey;
|
|
|
|
|
storeConfig.sdkSecret = appSecret;
|
|
|
|
|
storeConfig.apiServer = apiServer;
|
|
|
|
|
storeConfig.cryptType = cryptType;
|
|
|
|
|
[configs addObject:storeConfig];
|
|
|
|
|
}
|
2020-02-22 11:21:27 +08:00
|
|
|
|
|
2022-04-21 10:52:28 +08:00
|
|
|
|
FATConfig *config = [FATConfig configWithStoreConfigs:configs];
|
2020-02-22 11:21:27 +08:00
|
|
|
|
[[FATClient sharedClient] initWithConfig:config error:nil];
|
2023-03-07 14:04:48 +08:00
|
|
|
|
// 设置Log日志
|
|
|
|
|
[[FATClient sharedClient].logManager initLogWithLogDir:nil logLevel:FATLogLevelVerbose consoleLog:YES];
|
2020-02-22 11:21:27 +08:00
|
|
|
|
|
2020-12-18 09:28:26 +08:00
|
|
|
|
[FATClient sharedClient].delegate = [FINDemoClientHelper sharedHelper];
|
2021-08-19 19:47:47 +08:00
|
|
|
|
// 注入自定义api
|
|
|
|
|
[[FINExtensionHelper sharedHelper] registerCustomApis];
|
2020-12-18 09:28:26 +08:00
|
|
|
|
|
2022-08-03 11:54:58 +08:00
|
|
|
|
// // 注册百度地图
|
|
|
|
|
// [FATBDMapComponent setBDMapAppKey:@"申请的key"];
|
|
|
|
|
// // 注册高德地图
|
|
|
|
|
// [FATGDMapComponent setGDMapAppKey:@"申请的key"];
|
|
|
|
|
|
2023-03-07 14:04:48 +08:00
|
|
|
|
// 注册微信SDK
|
2023-03-07 14:10:33 +08:00
|
|
|
|
// 调试微信登录和微信支付时,需要修改bundleId,并配置跟bundleId匹配的微信 appKey、universalLink
|
2023-03-07 14:04:48 +08:00
|
|
|
|
// [WXApi registerApp:@"微信开放sdk的key" universalLink:@"微信开放sdk的universalLink"];
|
2020-12-04 14:09:34 +08:00
|
|
|
|
|
2020-02-22 11:21:27 +08:00
|
|
|
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
|
|
|
self.window.backgroundColor = [UIColor whiteColor];
|
2022-04-21 10:52:28 +08:00
|
|
|
|
|
|
|
|
|
MainViewController *mainVC = [[MainViewController alloc] init];
|
|
|
|
|
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:mainVC];
|
2020-02-22 11:21:27 +08:00
|
|
|
|
[self.window makeKeyAndVisible];
|
|
|
|
|
|
|
|
|
|
return YES;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-19 19:47:47 +08:00
|
|
|
|
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options {
|
2022-05-24 15:42:46 +08:00
|
|
|
|
return [WXApi handleOpenURL:url delegate:[FINExtensionHelper sharedHelper]];
|
2021-08-19 19:47:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-22 11:21:27 +08:00
|
|
|
|
@end
|