Integrate高德 SDK with simulator-safe build flags, add map views for operating area and punch points, refactor main tabs and key feature screens to UIKit with Diffable lists, and document Swift concurrency defaults in AGENTS.md. Co-authored-by: Cursor <cursoragent@cursor.com>
40 lines
1.2 KiB
Swift
40 lines
1.2 KiB
Swift
//
|
||
// AMapBootstrap.swift
|
||
// suixinkan
|
||
//
|
||
// 高德 SDK 初始化入口。真机构建时 AMAP_ENABLED 生效;模拟器构建时不链接 AMap。
|
||
//
|
||
|
||
import Foundation
|
||
|
||
#if AMAP_ENABLED
|
||
import AMapFoundationKit
|
||
import AMapLocationKit
|
||
import AMapSearchKit
|
||
import MAMapKit
|
||
|
||
/// 高德地图 SDK 初始化封装,真机构建时配置 Key 与隐私合规。
|
||
enum AMapBootstrap {
|
||
/// 在 App 启动时调用一次,配置 API Key 并声明隐私政策已展示与同意。
|
||
static func configure(apiKey: String) {
|
||
guard !apiKey.isEmpty else { return }
|
||
|
||
AMapServices.shared().apiKey = apiKey
|
||
AMapServices.shared().enableHTTPS = true
|
||
|
||
AMapSearchAPI.updatePrivacyShow(.didShow, privacyInfo: .didContain)
|
||
AMapSearchAPI.updatePrivacyAgree(.didAgree)
|
||
MAMapView.updatePrivacyShow(.didShow, privacyInfo: .didContain)
|
||
MAMapView.updatePrivacyAgree(.didAgree)
|
||
AMapLocationManager.updatePrivacyShow(.didShow, privacyInfo: .didContain)
|
||
AMapLocationManager.updatePrivacyAgree(.didAgree)
|
||
}
|
||
}
|
||
#else
|
||
/// 模拟器构建占位,不链接高德 SDK。
|
||
enum AMapBootstrap {
|
||
/// 空实现,保持调用方编译通过。
|
||
static func configure(apiKey: String) {}
|
||
}
|
||
#endif
|