Blame view

Twear/AppDelegate.swift 2.91 KB
75d24c15   yangbin   123
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
  //
  //  AppDelegate.swift
  //  Twear
  //
  //  Created by yangbin on 2021/11/16.
  //
  
  import UIKit
  import SwiftDate
  import IQKeyboardManagerSwift
  
  @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()
          
          if AdminHelper.shared.isFirstLaunch() {
              window?.rootViewController = LaunchViewController()
              window?.makeKeyAndVisible()
          } else {
              window?.rootViewController = ZCTabBarController()
              window?.makeKeyAndVisible()
          }
          
          IQKeyboardManager.shared.enable = true
          IQKeyboardManager.shared.shouldResignOnTouchOutside = true
          IQKeyboardManager.shared.enableAutoToolbar = false
          
          SwiftDate.defaultRegion = .current
          RealmTools.configRealm()
  
          object_setClass(Foundation.Bundle.main, HDFBundle.self)
          
          initSDK()
          return true
      }
  
      
      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: "358799895093653", appSecret: "0d2d1ec315f37e79d7e0bedc65ad31c8", displayName: "Qwear")
          }
          
      }
      
      
      
      // MARK: UISceneSession Lifecycle
  
  
  
  }