补充地图的演示功能
This commit is contained in:
@@ -38,6 +38,33 @@ end
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
# Flutter 默认配置
|
||||
flutter_additional_ios_build_settings(target)
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 1. Geolocator 配置 (你原来的代码)
|
||||
# ---------------------------------------------------------
|
||||
if target.name == "geolocator_apple"
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'BYPASS_PERMISSION_LOCATION_ALWAYS=1']
|
||||
end
|
||||
end
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 2. PermissionHandler 配置 (这是缺少的关键部分!!!)
|
||||
# 必须显式开启 'PERMISSION_LOCATION=1'
|
||||
# ---------------------------------------------------------
|
||||
target.build_configurations.each do |config|
|
||||
# 确保 GCC_PREPROCESSOR_DEFINITIONS 存在
|
||||
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
|
||||
|
||||
# 开启定位权限支持
|
||||
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'PERMISSION_LOCATION=1'
|
||||
|
||||
# 如果你需要其他权限,也在这里加,比如相机:
|
||||
# config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'PERMISSION_CAMERA=1'
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user