Baseflow / Baseflow/flutter-geolocator

[Bug]: getServiceStream only works when enable the Location Service on IOS

Open
#1,489 1 comment 0 reactions 0 assignees View on GitHub
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

Enable the location service then disable then enable it again

### Expected results

Return disabled when I disabled the Location Service

### Actual results

Nothing is return when I disabled the Location Service. Return Disabled and Enabled after I enabled the Location Service again

### Code sample

Code sample

```dart
Geolocator.getServiceStatusStream().listen((status) => print(status.name));
```

### Screenshots or video

_No response_

### Version

11.0.0

### Flutter Doctor output

Doctor output

```console
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.3.1 23D60 darwin-x64, locale en-MY)
• Flutter version 3.19.6 on channel stable at /Volumes/Data/Users/ksyeoh/Applications/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 54e66469a9 (7 days ago), 2024-04-17 13:08:03 -0700
• Engine revision c4cd48e186
• Dart version 3.3.4
• DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Volumes/Data/Users/ksyeoh/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Volumes/Data/Users/ksyeoh/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.15.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
• Android Studio at /Volumes/Data/Users/ksyeoh/Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.87.2)
• VS Code at /Volumes/Data/Users/ksyeoh/Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.86.0

[✓] Connected device (3 available)
• iPad (mobile) • 73bbad97bf4fafe9ef1746d558a697499fa50c81 • ios • iOS 17.4.1 21E236
• macOS (desktop) • macos • darwin-x64 • macOS 14.3.1 23D60 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.79
! Error: Browsing on the local area network for Jia Lin🐮. 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
• All expected network resources are available.

• No issues found!
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the sequence in the issue with Geolocator.getServiceStatusStream on iOS: enable the Location Service, disable it, then enable it again. Inspect the iOS implementation behind this stream and any existing related tests. Done means the stream reports the disabled state when the service is disabled and the enabled state after it is enabled again.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter, ios
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.