Skip to content

fix(ios): replace geolocator_apple with native when-in-use CoreLocation - #61

Merged
Lilin-1024 merged 1 commit into
shuosc:mainfrom
DanielZhangyc:fix/ios-native-location
Nov 27, 2026
Merged

Lilin-1024 merged 1 commit into
shuosc:mainfrom
DanielZhangyc:fix/ios-native-location

Conversation

@DanielZhangyc

@DanielZhangyc DanielZhangyc commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

改动摘要

修复上传 iOS 构建到 App Store Connect 时触发的静态检查报错(ITMS-90683):

Missing purpose string in Info.plist. Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “Runner.app” bundle should contain a NSLocationAlwaysAndWhenInUseUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. (90683)

原因:geolocator 引入的 geolocator_apple 在二进制中包含 requestAlwaysAuthorization 引用;若直接补上 NSLocationAlwaysAndWhenInUseUsageDescription,插件会优先申请 Always 定位权限,不符合校园地图仅前台定位的实际用途且存在过审风险。

新增 CampusMapLocationController.swift,仅调用 requestWhenInUseAuthorization();拆分单次定位与持续监听的 CLLocationManager。

对于 Android,隔离了相关实现,不会影响

关联 Issue

无

平台影响

  • iOS
  • Android
  • 不涉及平台代码

测试情况

  • 已运行 flutter analyze
  • 已运行 flutter test
  • 已进行安卓真机或模拟器验证
  • 已进行iOS真机或模拟器验证

@Lilin-1024
Lilin-1024 merged commit f988cd2 into shuosc:main Nov 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants