| | |
| | | import AMapFoundationKit |
| | | |
| | | @main |
| | | class AppDelegate: UIResponder, UIApplicationDelegate,WXApiDelegate { |
| | | class AppDelegate: UIResponder, UIApplicationDelegate { |
| | | |
| | | var window: UIWindow? |
| | | var orientation:UIInterfaceOrientationMask = .portrait |
| | |
| | | |
| | | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { |
| | | Services.startNetworkMonitor() |
| | | // WXApi.startLog(by: .normal) { text in |
| | | // print("LOGO====>\(text)\n") |
| | | // } |
| | | YYPaymentManager.shared.configuredWeChat(appID: WeChatAPPID, universalLink: WechatUniversalLinks) |
| | | YYPaymentManager.shared.configuredAlipay(appScheme: APPScheme) |
| | | AMapServices.shared().enableHTTPS = true |
| | | AMapServices.shared().apiKey = AMapKey |
| | | |
| | | // WXApi.checkUniversalLinkReady { step, result in |
| | | // print("====>\(step.rawValue):\(result.errorInfo)====\(result.suggestion)\n") |
| | | // |
| | | // } |
| | | return true |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { |
| | | print("---->") |
| | | return YYPaymentManager.shared.handleApplication(application, open: url, sourceApplication: sourceApplication, annotation: annotation) |
| | | } |
| | | |
| | | func application(_ application: UIApplication, handleOpen url: URL) -> Bool { |
| | | if ((url.scheme?.contains("wechat")) != nil){ |
| | | return WXApi.handleOpen(url, delegate: self) |
| | | } |
| | | |
| | | print("---->1") |
| | | return YYPaymentManager.shared.handleApplication(application, handleOpen: url) |
| | | } |
| | | |
| | | // NOTE: 9.0以后使用新API接口 |
| | | func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { |
| | | if ((url.scheme?.contains("wechat")) != nil){ |
| | | return WXApi.handleOpen(url, delegate: self) |
| | | } |
| | | print("---->2") |
| | | return YYPaymentManager.shared.handleApplication(app, open: url, options: options) |
| | | } |
| | | |
| | | func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { |
| | | return WXApi.handleOpenUniversalLink(userActivity, delegate: self) |
| | | print("---->3") |
| | | return YYPaymentManager.shared.handleApplication(userActivity) |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | extension AppDelegate{ |
| | |
| | | let loginNav = LoginNav(rootViewController: LoginVC()) |
| | | loginNav.modalPresentationStyle = .fullScreen |
| | | JQ_currentViewController().present(loginNav, animated: true) |
| | | } |
| | | } |
| | | |
| | | extension AppDelegate{ |
| | | func onReq(_ req: BaseReq) { |
| | | |
| | | } |
| | | |
| | | func onResp(_ resp: BaseResp) { |
| | | |
| | | } |
| | | } |
| | | |