Baseflow / Baseflow/flutter-geolocator
[Bug]: Swift Package does not obey BYPASS_PERMISSION_LOCATION_ALWAYS setting
- Dominant language
- Dart
- Stars
- 1.3k
- Forks
- 803
- Avg merge
- 8h 16m
- Merged PRs (30d)
- 1
Description
### Please check the following before submitting a new issue.
- [x] I have searched the [existing issues](https://github.com/baseflow/flutter-geolocator/issues).
- [x] I have carefully [read the documentation](https://github.com/Baseflow/flutter-geolocator/blob/main/geolocator/README.md) and verified I have added the required platform specific configuration.
### Please select affected platform(s)
- [ ] Android
- [x] iOS
- [ ] Linux
- [ ] macOS
- [ ] Web
- [ ] Windows
### Steps to reproduce
1. `flutter create --platforms=ios geolocator_package_bug`
2. Set your `pubspec.yaml` to enable swift package manager:
```yaml
flutter:
config:
enable-swift-package-manager: true
```
3. Add `geolocator` to your dependencies, along with a package that still uses Pods (eg, `flutter_keyboard_visibility`), to force the Podfile to be created.
4. To generate the initial Podfile: `flutter build ios --release`
5. Add the `config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'BYPASS_PERMISSION_LOCATION_ALWAYS=1']` section to the Podfile, as defined in the README.
6. `flutter clean && flutter build ios --release`
7. `strings build/ios/iphoneos/Runner.app/Runner | grep -c "requestAlwaysAuthorization"`
### Expected results
```
% strings build/ios/iphoneos/Runner.app/Runner | grep -c "requestAlwaysAuthorization"
0
```
### Actual results
```
% strings build/ios/iphoneos/Runner.app/Runner | grep -c "requestAlwaysAuthorization"
1
```
### Code sample
No additional code required.
### Screenshots or video
_No response_
### Version
14.0.2
### Flutter Doctor output
Doctor output
```console
[!] Flutter (Channel [user-branch], 3.35.7, on macOS 26.2 25C56 darwin-arm64, locale en-AU)
! Flutter version 3.35.7 on channel [user-branch] at /Users/pento/Projects/flutter
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
! Upstream repository unknown source is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.2)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2025.2)
[✓] VS Code (version 1.107.1)
[✓] Connected device (3 available)
! Error: Browsing on the local area network for Your iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
```
Contributor guide
Research direction
Start with the geolocator README's BYPASS_PERMISSION_LOCATION_ALWAYS Podfile configuration and reproduce the issue using the listed Flutter iOS build steps with Swift Package Manager enabled. Inspect how the iOS package consumes the Podfile build setting, then verify the fix with the strings build/ios/iphoneos/Runner.app/Runner command; done means requestAlwaysAuthorization is absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, ios, swift
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 66/100