AppDelegate.swift
3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//
// AppDelegate.swift
// Twear
//
// Created by yangbin on 2021/11/16.
//
import UIKit
import SwiftDate
import IQKeyboardManagerSwift
import AVFoundation
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow()
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.shouldResignOnTouchOutside = true
IQKeyboardManager.shared.enableAutoToolbar = false
SwiftDate.defaultRegion = .current
RealmTools.configRealm()
object_setClass(Foundation.Bundle.main, HDFBundle.self)
if AdminHelper.shared.isFirstLaunch() {
window?.rootViewController = LaunchViewController()
window?.makeKeyAndVisible()
} else {
window?.rootViewController = ZCTabBarController()
window?.makeKeyAndVisible()
}
initSDK()
return true
}
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return .portrait
}
func initSDK() {
//天气QWeather.
AllWeatherInquieirs.sharedInstance().appKey = "9d50ca989b6e441aa5db78494479ed6e"
AllWeatherInquieirs.sharedInstance().publicID = "HE2112221638291473"
AllWeatherInquieirs.sharedInstance().appType = .DEV
//高德地图
AMapServices.shared().enableHTTPS = true
AMapServices.shared().apiKey = "2746712bd306b3543a263e93b6849d48"
//分享 注册平台
ShareSDK.registPlatforms { platformsRegister in
let universalLink = "4c4f12be4f7221d073786a1e98be5601.share2dlink.com"
platformsRegister?.setupWeChat(withAppId: "wx76c8e91b90baa0bb", appSecret: "fe2c51571b50519667c88db7fe6764cb", universalLink: "https://4c4f12be4f7221d073786a1e98be5601.share2dlink.com/")
platformsRegister?.setupQQ(withAppId: "101988383", appkey: "a268282dfeb77f59f5b81265fd5c575b", enableUniversalLink: true, universalLink: "https://4c4f12be4f7221d073786a1e98be5601.share2dlink.com/qq_conn/101988383")
platformsRegister?.setupSinaWeibo(withAppkey: "568898243", appSecret: "38a4f8204cc784f81f9f0daaf31e02e3", redirectUrl: nil, universalLink: universalLink)
// platformsRegister?.setupTwitter(withKey: "LRBM0H75rWrU9gNHvlEAA2aOy", secret: "gbeWsZvA9ELJSdoBzJ5oLKX0TU09UOwrzdGfo9Tg7DjyGuMe8G", redirectUrl: "http://mob.com")
platformsRegister?.setupInstagram(withClientId: "379235043053926", clientSecret: "581da6660ee4ede2873128ebd310d7e9", redirectUrl: nil)
platformsRegister?.setupFacebook(withAppkey: "656411005631251", appSecret: "2963cb646d3000b71a7fc2a4bef7a20e", displayName: "HDF wear")
}
}
// MARK: UISceneSession Lifecycle
}