AppDelegate.swift 3.13 KB
//
//  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



}