fix(permission): correct foreground and background location flow - #329
Merged
yyy-router merged 2 commits intoAug 20, 2026
Merged
Conversation
LUPENGHAN
marked this pull request as ready for review
August 20, 2026 12:15
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ings openSettings() called requestForegroundPermissionsAsync/requestBackgroundPermissionsAsync again after the caller already got a denial from requestPermission(), resurfacing the same system dialog instead of routing to app settings. It now only reads current status and falls back to Linking.openSettings() once the system truly won't ask again. Also adds coverage for the previously-untested onAppActive recovery branches (permission unchanged after returning from settings, getStatus() rejecting) and the default expo-location loader path.
yyy-router
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #328.
摘要
修复定位权限状态误判、权限重复弹窗,以及前台/后台定位权限引导不一致的问题。
背景
真实 Development Build 中动态加载
expo-location可能失败,导致已授权的定位权限被误判为未授权。同时,语音握手和地理围栏注册会主动申请权限,造成权限提示时机不稳定,用户从系统设置返回后还可能再次看到相同弹窗。主要改动
expo-location改为静态导入,确保能够正确读取系统权限状态。useReminderPermissionsOnLaunch。ExpoLocationProvider和ExpoLocationMonitor只读取权限状态,不再主动申请权限。行为变化
验证
git diff --check:通过范围
本 PR 只调整客户端权限编排和定位适配层,不修改: