Files
e-party-iOS/yana/AppDelegate.swift
edwinQQQ 007c10daaf feat: 添加Swift Package管理和API功能模块
新增Package.swift和Package.resolved文件以支持Swift Package管理,创建API相关文件(API.swift、APICaller.swift、APIConstants.swift、APIEndpoints.swift、APIService.swift、APILogger.swift、APIModels.swift、Integration-Guide.md)以实现API请求管理和网络交互功能,增强项目的功能性和可扩展性。同时更新.gitignore以排除构建文件和临时文件。
2025-06-04 17:25:21 +08:00

35 lines
1.2 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import UIKit
import NIMSDK
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//
// NetworkManager.shared.networkStatusChanged = { status in
// print("🌍 \(status)")
// }
#if DEBUG
//
let testURL = URL(string: "http://beta.api.molistar.xyz/client/init")!
let request = URLRequest(url: testURL)
print("🛠 原生URLSession测试开始")
URLSession.shared.dataTask(with: request) { data, response, error in
print("""
=== 网络诊断结果 ===
响应状态码: \((response as? HTTPURLResponse)?.statusCode ?? -1)
错误信息: \(error?.localizedDescription ?? "")
原始数据: \(data?.count ?? 0) bytes
==================
""")
}.resume()
#endif
// NIMConfigurationManager.setupNimSDK()
return true
}
}