flutter_background_geolocation icon indicating copy to clipboard operation
flutter_background_geolocation copied to clipboard

HeadlessTask timeout !!

Open Benkhouds opened this issue 2 years ago • 1 comments

Your Environment

  • Plugin version: 4.6.3

  • Platform: Android

  • OS version:

  • Device manufacturer / model:

  • Flutter info (flutter doctor): [√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.22000.675], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4) [√] Android Studio (version 2021.1) [√] VS Code (version 1.67.2) [√] Connected device (4 available) [√] HTTP Host Availability

  • Plugin config:

class BackgroundGeolocationTasks {
  static registerTasks() async {
    await BackgroundGeolocation.registerHeadlessTask(
      backgroundGeolocationHeadlessTask,
    );
  }
}
void backgroundGeolocationHeadlessTask(HeadlessEvent headlessEvent) async {
  if(headlessEvent.name) {
      Location location = headlessEvent.event;
      debugPrint("headless mode :$location");
   }

Expected Behavior

i'm expecting the location to be printed when i kill the app

Actual Behavior

nothing happens and the notification disappears when i kill the app. I didn't configure Background Fetch and i think it's the problem. So i just want to make sure, is it necessary to configure backgroundFetch for the headless mode to work ??

Steps to Reproduce

Context

I'm trying to get the location when the app is killed and save it locally (hive db), is it possible even for ios to add a dart callback when the app is killed?

Debug logs

Logs
PASTE_YOUR_LOGS_HERE

Benkhouds avatar Jun 12 '22 14:06 Benkhouds

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale[bot] avatar Sep 21 '22 05:09 stale[bot]