Add ScenicPermission module and AMap CocoaPods with simulator support.
Integrate scenic selection and permission flows into home routing, add AMap SDK for device builds while keeping arm64 simulators compilable via Podfile post_install hooks. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
36
suixinkan/App/AMapBootstrap.swift
Normal file
36
suixinkan/App/AMapBootstrap.swift
Normal file
@ -0,0 +1,36 @@
|
||||
//
|
||||
// AMapBootstrap.swift
|
||||
// suixinkan
|
||||
//
|
||||
// 高德 SDK 初始化入口。真机构建时 AMAP_ENABLED 生效;模拟器构建时不链接 AMap。
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
#if AMAP_ENABLED
|
||||
import AMapFoundationKit
|
||||
import AMapLocationKit
|
||||
import AMapSearchKit
|
||||
import MAMapKit
|
||||
|
||||
enum AMapBootstrap {
|
||||
/// 在 App 启动时调用一次。将 `apiKey` 替换为高德控制台申请的 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
|
||||
enum AMapBootstrap {
|
||||
static func configure(apiKey: String) {}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user