transistorsoft / flutter_background_geolocation

Sophisticated, battery-conscious background-geolocation & geofencing with motion-detection
https://www.transistorsoft.com/shop/products/flutter-background-geolocation
Other
640 stars 237 forks source link

Release build not working with confirmed license #844

Closed lloydelvt closed 3 months ago

lloydelvt commented 1 year ago

Flutter/Android Studio



## Expected Behavior
In headless task, We are expecting to receive location updates as it calls the same update location function as the onLocation call and it works as expected. In the debug build version of the application it works perfectly but in the release build the code in the headless task does not upload correctly. We have tested the license in the demo application and received no error as well as the demo application working as expected. Please advise
christocracy commented 1 year ago

Are you observing your logs with $ adb logcat *:S TSLocationManager:V? See wiki Debugging.

The easiest way to invoke a headless event is to bring your app to foreground then immediately terminate. Exactly 10s after terminate, the plugin will cause your app to be relaunched headless. Do not test headless operation from an app launched in the IDE.

10-07 11:19:15.748 23332 23332 I TSLocationManager:   ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
.
. <--- 10 seconds elapse...
.
10-07 11:19:26.286 23611 23634 I TSLocationManager: ╔═════════════════════════════════════════════
10-07 11:19:26.286 23611 23634 I TSLocationManager: ║ TSLocationManager version: 3.2.5 (411)
10-07 11:19:26.286 23611 23634 I TSLocationManager: ╠═════════════════════════════════════════════
10-07 11:19:26.286 23611 23634 I TSLocationManager: ╟─ Google Pixel 6 @ 13 (flutter)
10-07 11:19:26.286 23611 23634 I TSLocationManager: {
...
}
.
.
.
10-07 11:19:27.437 23611 23647 I flutter : 📬 --> [HeadlessEvent name: providerchange, event: [ProviderChangeEvent enabled:true, status: 3, network: true, gps: true, accuracyAuthorization: 0]]
10-07 11:19:27.449 23611 23647 I flutter : 📬 --> [HeadlessEvent name: connectivitychange, event: [ConnectivityChangeEvent connected: true]]
10-07 11:19:27.449 23611 23647 I flutter : [ConnectivityChangeEvent connected: true]
10-07 11:19:27.493 23611 23647 I flutter : 📬 --> [HeadlessEvent name: terminate, event: [State enabled: true, isMoving: false, trackingMode: 1, desiredAccuracy: -1, distanceFilter: 50.0, odometer: 0.0, schedulerEnabled: false, foregroundService: true]]
lloydelvt commented 1 year ago

We are not observing the logs as we are testing on real devices through Android Google Play BETA. When trying to implement sending the logs to email we are getting an error. When built in debug mode the package is working perfectly and location are being reported as expected even in the terminated state. However when built in release mode, the terminated state stops reporting the location.

christocracy commented 1 year ago

We are not observing the logs as we are testing on real devices through Android Google Play BETA

You can easily build a local release .apk via

$ flutter build apk

it’s how I install and test release versions of my /example app on my 13 test devices.

lloydelvt commented 1 year ago

I have attached the logs below from the android device. I apologize my understanding of the logs was incorrect. It seems that the headless event is waiting to fire for some sort of initialization.

2022-10-12 14:35:56.115 12563-12563 TSLocationManager pid-12563 I [c.t.l.s.TSScheduleManager oneShot] ⏰ Oneshot TERMINATE_EVENT is already pending 2022-10-12 14:35:56.595 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: location 2022-10-12 14:35:56.596 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: motionchange 2022-10-12 14:35:56.596 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: activitychange 2022-10-12 14:35:56.597 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: geofence 2022-10-12 14:35:56.597 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: heartbeat 2022-10-12 14:35:56.598 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: http 2022-10-12 14:35:56.598 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: schedule 2022-10-12 14:35:56.599 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: connectivitychange 2022-10-12 14:35:56.600 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: enabledchange 2022-10-12 14:35:56.600 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: providerchange 2022-10-12 14:35:56.601 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: powersavechange 2022-10-12 14:35:56.601 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: notificationaction 2022-10-12 14:35:56.602 12563-12563 TSLocationManager pid-12563 I [c.t.l.s.TSScheduleManager cancelOneShot] ⏰ Cancel OneShot: TERMINATE_EVENT 2022-10-12 14:35:56.604 12563-12563 TSLocationManager pid-12563 D [c.t.l.l.LifecycleManager a] ╔═════════════════════════════════════════════ ║ ☯️ HeadlessMode? true ╠═════════════════════════════════════════════ 2022-10-12 14:35:56.607 12563-12563 TSLocationManager pid-12563 D [c.t.f.b.HeadlessTask onHeadlessEvent] 💀 [HeadlessTask terminate] 2022-10-12 14:35:56.607 12563-12563 TSLocationManager pid-12563 D [c.t.l.a.BackgroundGeolocation b] 🔴 Cleared callbacks 2022-10-12 14:35:56.608 12563-13017 TSLocationManager pid-12563 I [c.t.l.a.BackgroundGeolocation$l0 run] ╔═════════════════════════════════════════════ ║ MainActivity was destroyed ╠═════════════════════════════════════════════ ╟─ stopOnTerminate: false ╟─ enabled: true 2022-10-12 14:35:56.636 12563-12563 TSLocationManager pid-12563 D [c.t.f.b.HeadlessTask dispatch] [HeadlessTask] waiting for client to initialize 2022-10-12 14:35:56.769 12563-12563 TSLocationManager pid-12563 D [c.t.l.l.LifecycleManager onPause] ☯️ onPause 2022-10-12 14:35:56.770 12563-12563 TSLocationManager pid-12563 D [c.t.l.l.LifecycleManager onStop] ☯️ onStop

christocracy commented 1 year ago

Post your lib/main.dart

christocracy commented 1 year ago

Release build not working with confirmed license

How is your current issue related to licensing?

lloydelvt commented 1 year ago

We assumed it was a licensing issue as the code works in the debug mode but not when built in release mode.

lloydelvt commented 1 year ago

Would you like me to paste the whole Lib/main.dart here?

christocracy commented 1 year ago

When you have a licensing issue, there is a Toast message “Invalid License”.

christocracy commented 1 year ago

Like I said: “Post your lib/main.dart

lloydelvt commented 1 year ago
import 'dart:developer';

import 'package:background_fetch/background_fetch.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:motormouth/local_data/app_data.dart';
import 'package:motormouth/models/garage.dart';
import 'package:motormouth/models/vehicle_used_shared.dart';
import 'package:motormouth/screens/dashboard/dashboard.dart';
import 'package:motormouth/screens/garage/garage.dart';
import 'dart:async';
import 'package:motormouth/screens/login/login.dart';
import 'package:motormouth/screens/people/people_home.dart';
import 'package:motormouth/screens/splash_screen/splash_screen.dart';
import 'package:motormouth/screens/vehicles/vehicle_home.dart';
import 'package:motormouth/widgets/widgets.dart';
import 'package:flutter_background_geolocation/flutter_background_geolocation.dart'
    as bg;
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'firebase_options.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';

import 'api/api_access.dart';
import 'models/vehicle.dart';
import 'models/vehicle_location.dart';

Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
  await Firebase.initializeApp();
  // await setupFlutterNotifications();
  // showFlutterNotification(message);
  // If you're going to use other Firebase services in the background, such as Firestore,
  // make sure you call `initializeApp` before using other Firebase services.
  // Here is where the background handler would set an active trip and create the geofences
  print('Handling a background message ${message.messageId}');
}

/// Create a [AndroidNotificationChannel] for heads up notifications
late AndroidNotificationChannel channel;
late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;

bool isFlutterLocalNotificationsInitialized = false;

Future<void> setupFlutterNotifications() async {
  print('running setupFlutterNotifications');
  if (isFlutterLocalNotificationsInitialized) {
    return;
  }
  channel = const AndroidNotificationChannel(
    'high_importance_channel', // id
    'High Importance Notifications', // title
    description:
        'This channel is used for important notifications.', // description
    importance: Importance.high,
  );

  flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();

  /// Create an Android Notification Channel.
  ///
  /// We use this channel in the `AndroidManifest.xml` file to override the
  /// default FCM channel to enable heads up notifications.
  await flutterLocalNotificationsPlugin
      .resolvePlatformSpecificImplementation<
          AndroidFlutterLocalNotificationsPlugin>()
      ?.createNotificationChannel(channel);

  /// Update the iOS foreground notification presentation options to allow
  /// heads up notifications.
  await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(
    alert: true,
    badge: true,
    sound: true,
  );
  isFlutterLocalNotificationsInitialized = true;
}

void showFlutterNotification(RemoteMessage message) {
  print('Got a message whilst in the foreground!');
  print('Message data: ${message.data}');

  if (message.notification != null) {
    print('Message also contained a notification: ${message.notification}');
  }
  RemoteNotification? notification = message.notification;
  AndroidNotification? android = message.notification?.android;
  if (notification != null && android != null) {
    flutterLocalNotificationsPlugin.show(
      notification.hashCode,
      notification.title,
      notification.body,
      NotificationDetails(
        android: AndroidNotificationDetails(
          channel.id,
          channel.name,
          channelDescription: channel.description,
          // TODO add a proper drawable resource to android, for now using
          //      one that already exists in example app.
          icon: 'launch_background',
          importance: Importance.high,
          priority: Priority.high,
          playSound: true,
        ),
      ),
    );
  }
}

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  AppData.init();
  initPlatformState();

  // test
  await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
  FirebaseMessaging messaging = FirebaseMessaging.instance;
  NotificationSettings settings = await messaging.requestPermission(
    alert: true,
    announcement: false,
    badge: true,
    carPlay: false,
    criticalAlert: false,
    provisional: false,
    sound: true,
  );

  if (settings.authorizationStatus == AuthorizationStatus.authorized) {
    print('User granted permission');
  } else if (settings.authorizationStatus == AuthorizationStatus.provisional) {
    print('User granted provisional permission');
  } else {
    print('User declined or has not accepted permission');
  }
  FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);

  FirebaseMessaging.onMessage.listen((RemoteMessage message) {
    print('Got a message whilst in the foreground!');
    print('Message data: ${message.data}');

    if (message.notification != null) {
      print('Message also contained a notification: ${message.notification}');
    }
  });
  // end test

  // await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
  // FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
  // FirebaseMessaging.onMessage.listen(showFlutterNotification);

  runApp(MyApp());
  BackgroundFetch.registerHeadlessTask(backgroundFetchHeadlessTask);
}

class MyApp extends StatefulWidget {
  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool showSplashScreen = true;

  @override
  void initState() {
    super.initState();
    // _getUserLocation();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: AppData.navStackKey,
      theme: AppTheme.appTheme,
      // home: DashboardHome(),
      // initialRoute: '/homepage',
      // home:  Test(),
      initialRoute: AppData.bearer == '' ? '/login' : '/homepage',
      routes: {
        //'/splash_screen': (context) => SplashScreen(),
        '/login': (context) => LoginOrSignUpWebview(),
        '/homepage': (context) => MyHomePage(),
      },
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _selectedIndex = 0;
  VehicleUsedShared? vehicleUsedShared;
  List<GarageVehicle> _vehicleListResult = [];

  List<Widget> _widgetOptions = <Widget>[
    DashboardHome(),
    PeopleHome(),
    // TripHome(),
    //GarageHome(),
    VehicleHome()
    //DevEnvironment(),
  ];

  @override
  void initState() {
    preloadData();
    super.initState();
  }

  Future<void> preloadData() async {
    // await DeviceLocation.getUserPermission();
    //This is to wake the Teslas up asynchronously to allow for shorter
    // load times on the Vehicle Home page

  }

  @override
  Widget build(BuildContext context) {
    return SendToBackground(
      child: Scaffold(
        body: SafeArea(
          child: _widgetOptions.elementAt(_selectedIndex),
        ),
        bottomNavigationBar: BottomNavigationBar(
          items: <BottomNavigationBarItem>[
            BottomNavigationBarItem(
                icon: SizedBox(
                    height: 20,
                    width: 16,
                    child: Image.asset(
                      "assets/images/trip_active.png",
                      color: Colors.grey,
                    )),
                label: 'Trips',
                activeIcon: SizedBox(
                    height: 20,
                    width: 16,
                    child: Image.asset(
                      "assets/images/trip_active.png",
                    )),
                backgroundColor: Colors.white),
            BottomNavigationBarItem(
                icon: Container(
                  child: Icon(
                    Icons.account_circle_outlined,
                  ),
                ),
                label: 'People',
                activeIcon: Icon(Icons.account_circle),
                backgroundColor: Colors.white),
            BottomNavigationBarItem(
                icon: Container(
                  child: Icon(
                    Icons.garage_outlined,
                  ),
                ),
                label: 'Vehicles',
                activeIcon: Icon(Icons.garage),
                backgroundColor: Colors.white),
          ],
          currentIndex: _selectedIndex,
          unselectedItemColor: Colors.grey,
          selectedItemColor: Color.fromRGBO(15, 45, 122, 1),
          onTap: (int index) {
            setState(() {
              _selectedIndex = index;
            });
          },
        ),
      ),
    );
  }
}

/// register headless task for Android only
void backgroundFetchHeadlessTask(HeadlessTask task) async {
  String taskId = task.taskId;
  bool isTimeout = task.timeout;
  if (isTimeout) {
    // This task has exceeded its allowed running-time.
    // You must stop what you're doing and immediately .finish(taskId)
    BackgroundFetch.finish(taskId);
    return;
  }
  await _sendLocation();
  BackgroundFetch.finish(taskId);
}

Future<void> initPlatformState() async {
  // Configure BackgroundFetch.
  int status = await BackgroundFetch.configure(
      BackgroundFetchConfig(
          minimumFetchInterval: 15,
          stopOnTerminate: false,
          enableHeadless: true,
          requiresBatteryNotLow: false,
          requiresCharging: false,
          requiresStorageNotLow: false,
          requiresDeviceIdle: false,
          requiredNetworkType: NetworkType.NONE), (String taskId) async {
    // <-- Event handler
    // This is the fetch-event callback.
    await _sendLocation();

    /// IMPORTANT:  You must signal completion of your task or the OS can punish your app
    /// for taking too long in the background.
    BackgroundFetch.finish(taskId);
  }, (String taskId) async {
    // <-- Task timeout handler.
    // This task has exceeded its allowed running-time.  You must stop what you're doing and immediately .finish(taskId)
    BackgroundFetch.finish(taskId);
  });
}

Future<void> _sendLocation() async {
  await AppData.initBackgroundIsolate();

  final location = await bg.BackgroundGeolocation.getCurrentPosition();
  final coordinates = location.coords;
  AppData.userPosition = Position(
      longitude: coordinates.longitude,
      latitude: coordinates.latitude,
      timestamp: DateTime.now(),
      accuracy: coordinates.accuracy,
      altitude: coordinates.altitude,
      heading: coordinates.heading,
      speed: coordinates.speed,
      speedAccuracy: coordinates.speedAccuracy);

  await ApiAccess.sendUserLocation();
}
christocracy commented 1 year ago

Please learn to syntax highlight code blocks

christocracy commented 1 year ago
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  AppData.init();
  //initPlatformState();  <--- You CANNOT do this here.  Disable it.
}

You CANNOT call BackgroundFetch.configure in the headless state. Move BackgroundFetch.configure into the same source-file where you have bg.BackgroundGeolocation.ready(config).

BackgroundFetch has its own headless mechanism, similar to BackgroundGeolocation. Read the docs for background_fetch.

christocracy commented 1 year ago

BackgroundFetchConfig.enableHeadless

christocracy commented 1 year ago

You could also move BackgroundFetch.configure into here:

BackgroundFetch.configure(config) MUST be placed within one of your widgets.

class _MyAppState extends State<MyApp> {
  bool showSplashScreen = true;

  @override
  void initState() {
    super.initState();
    // Configure BackgroundFetch.
    int status = await BackgroundFetch.configure(
        BackgroundFetchConfig(
            minimumFetchInterval: 15,
            stopOnTerminate: false,
            enableHeadless: true,
            requiresBatteryNotLow: false,
            requiresCharging: false,
            requiresStorageNotLow: false,
            requiresDeviceIdle: false,
            requiredNetworkType: NetworkType.NONE), (String taskId) async {
      // <-- Event handler
      // This is the fetch-event callback.
      await _sendLocation();

      /// IMPORTANT:  You must signal completion of your task or the OS can punish your app
      /// for taking too long in the background.
      BackgroundFetch.finish(taskId);
    }, (String taskId) async {
      // <-- Task timeout handler.
      // This task has exceeded its allowed running-time.  You must stop what you're doing and immediately .finish(taskId)
      BackgroundFetch.finish(taskId);
    });    
  }
}
lloydelvt commented 1 year ago

I moved the background fetch configure into the initState() and disabled the earlier initialization like you suggested above and still received the same log message. (pasted below)

2022-10-12 16:06:20.863 24718-24718 TSLocationManager pid-24718 I [c.t.l.s.TSScheduleManager oneShot] ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588) 2022-10-12 16:06:21.406 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: location 2022-10-12 16:06:21.407 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: motionchange 2022-10-12 16:06:21.407 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: activitychange 2022-10-12 16:06:21.407 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: geofence 2022-10-12 16:06:21.408 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: heartbeat 2022-10-12 16:06:21.408 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: http 2022-10-12 16:06:21.409 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: schedule 2022-10-12 16:06:21.409 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: connectivitychange 2022-10-12 16:06:21.410 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: enabledchange 2022-10-12 16:06:21.411 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: providerchange 2022-10-12 16:06:21.411 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: powersavechange 2022-10-12 16:06:21.412 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: notificationaction 2022-10-12 16:06:21.413 24718-24718 TSLocationManager pid-24718 I [c.t.l.s.TSScheduleManager cancelOneShot] ⏰ Cancel OneShot: TERMINATE_EVENT 2022-10-12 16:06:21.414 24718-24718 TSLocationManager pid-24718 D [c.t.l.l.LifecycleManager a] ╔═════════════════════════════════════════════ ║ ☯️ HeadlessMode? true ╠═════════════════════════════════════════════ 2022-10-12 16:06:21.415 24718-24718 TSLocationManager pid-24718 D [c.t.f.b.HeadlessTask onHeadlessEvent] 💀 [HeadlessTask terminate] 2022-10-12 16:06:21.416 24718-24718 TSLocationManager pid-24718 D [c.t.l.a.BackgroundGeolocation b] 🔴 Cleared callbacks 2022-10-12 16:06:21.416 24718-26695 TSLocationManager pid-24718 I [c.t.l.a.BackgroundGeolocation$l0 run] ╔═════════════════════════════════════════════ ║ MainActivity was destroyed ╠═════════════════════════════════════════════ ╟─ stopOnTerminate: false ╟─ enabled: true 2022-10-12 16:06:21.434 24718-24718 TSLocationManager pid-24718 D [c.t.f.b.HeadlessTask dispatch] [HeadlessTask] waiting for client to initialize 2022-10-12 16:06:21.512 24718-24718 TSLocationManager pid-24718 D [c.t.l.l.LifecycleManager onPause] ☯️ onPause 2022-10-12 16:06:21.513 24718-24718 TSLocationManager pid-24718 D [c.t.l.l.LifecycleManager onStop] ☯️ onStop

When I moved the background fetch configure into the same place as the background geolocation and disabled the earlier initialization like you suggested in the first message I received this log (pasted below)

                                                                                                  ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)

2022-10-12 16:16:09.099 28159-28159 TSLocationManager pid-28159 D [c.t.l.l.LifecycleManager onPause] ☯️ onPause 2022-10-12 16:16:09.099 28159-28159 TSLocationManager pid-28159 D [c.t.l.l.LifecycleManager onStop] ☯️ onStop 2022-10-12 16:16:09.284 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: location 2022-10-12 16:16:09.284 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: motionchange 2022-10-12 16:16:09.284 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: activitychange 2022-10-12 16:16:09.285 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: geofence 2022-10-12 16:16:09.285 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: heartbeat 2022-10-12 16:16:09.286 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: http 2022-10-12 16:16:09.286 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: schedule 2022-10-12 16:16:09.287 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: connectivitychange 2022-10-12 16:16:09.288 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: enabledchange 2022-10-12 16:16:09.288 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: providerchange 2022-10-12 16:16:09.289 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: powersavechange 2022-10-12 16:16:09.289 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation removeListener] ✅ removeListener event: notificationaction 2022-10-12 16:16:09.291 28159-28159 TSLocationManager pid-28159 I [c.t.l.s.TSScheduleManager cancelOneShot] ⏰ Cancel OneShot: TERMINATE_EVENT 2022-10-12 16:16:09.293 28159-28159 TSLocationManager pid-28159 D [c.t.l.l.LifecycleManager a] ╔═════════════════════════════════════════════ ║ ☯️ HeadlessMode? true ╠═════════════════════════════════════════════ 2022-10-12 16:16:09.295 28159-28159 TSLocationManager pid-28159 D [c.t.f.b.HeadlessTask onHeadlessEvent] 💀 [HeadlessTask terminate] 2022-10-12 16:16:09.295 28159-28159 TSLocationManager pid-28159 D [c.t.l.a.BackgroundGeolocation b] 🔴 Cleared callbacks 2022-10-12 16:16:09.297 28159-28775 TSLocationManager pid-28159 I [c.t.l.a.BackgroundGeolocation$l0 run] ╔═════════════════════════════════════════════ ║ MainActivity was destroyed ╠═════════════════════════════════════════════ ╟─ stopOnTerminate: false ╟─ enabled: true 2022-10-12 16:16:09.333 28159-28159 TSLocationManager pid-28159 D [c.t.f.b.HeadlessTask dispatch] [HeadlessTask] waiting for client to initialize

christocracy commented 1 year ago

I suggest you create for yourself a simple Hello World app and experiment with headless-mode in isolation of your main app.

github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 3 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.