Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: In Android 11 not able to fetch long in background #1588

Open
3 of 8 tasks
Dhiren198 opened this issue Oct 10, 2024 · 0 comments
Open
3 of 8 tasks

[Bug]: In Android 11 not able to fetch long in background #1588

Dhiren198 opened this issue Oct 10, 2024 · 0 comments

Comments

@Dhiren198
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Steps to reproduce

In Android 11 not able to fetch long in background

Expected results

to get lat long when app in background

Actual results

in background not response and no log producing

Code sample

@pragma('vm:entry-point')
Future<Position?> _determieOffline() async {

late LocationSettings locationSettings;
locationSettings = AndroidSettings(
accuracy: LocationAccuracy.high,
distanceFilter: 100,
forceLocationManager: true,
intervalDuration: const Duration(seconds: 10),

  foregroundNotificationConfig: const ForegroundNotificationConfig(
    notificationText:
        "Example app will continue to receive your location even when you aren't using it",
    notificationTitle: "Running in Background",
    enableWakeLock: true,
  ));

print("before get current position");
Position? position;
try {
position =
await Geolocator.getCurrentPosition(locationSettings: locationSettings);
} catch (e) {
print("the error geooffline is $e");
}
return position;
}

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

geolocator: ^13.0.1

Flutter Doctor output

lb@LBs-MacBook-Pro ~ % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0 24A335 darwin-x64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.94.1)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!
lb@LBs-MacBook-Pro ~ %

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

No branches or pull requests

1 participant